From 603dc07581309e59bab1afa24c85e594338fadb6 Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Tue, 3 Aug 2021 21:37:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=8B=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/config/index.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/config/index.tsx b/src/pages/config/index.tsx index 4a7847a1..149c92e9 100644 --- a/src/pages/config/index.tsx +++ b/src/pages/config/index.tsx @@ -1,4 +1,10 @@ -import React, { PureComponent, Fragment, useState, useEffect, useRef } from 'react'; +import React, { + PureComponent, + Fragment, + useState, + useEffect, + useRef, +} from 'react'; import { Button, message, Modal, TreeSelect } from 'antd'; import config from '@/utils/config'; import { PageContainer } from '@ant-design/pro-layout'; @@ -34,7 +40,9 @@ const Config = () => { }; const updateConfig = () => { - const content = editorRef.current.getValue().replace(/\r\n/g, '\n'); + const content = editorRef.current + ? editorRef.current.getValue().replace(/\r\n/g, '\n') + : value; request .post(`${config.apiPrefix}configs/save`, {