From 08ad756b6b8ab1e80edcb17b25eaca1a46ac044d Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 7 Mar 2023 09:18:35 +0800 Subject: [PATCH] =?UTF-8?q?wiki=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=97=B6=E3=80=81=E4=BF=9D=E5=AD=98=E6=8C=89=E9=92=AE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Wiki/EditWiki.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/forge/Wiki/EditWiki.jsx b/src/forge/Wiki/EditWiki.jsx index cb786c3f..e4612b74 100644 --- a/src/forge/Wiki/EditWiki.jsx +++ b/src/forge/Wiki/EditWiki.jsx @@ -23,6 +23,7 @@ export default Form.create()(({ form, history, showNotification, projectDetail, const [content, setContent] = useState(undefined); const [modal, setModal] = useState(false); + const [operateFlag, setOperateFlag ] = useState(false); const [modalType, setModalType] = useState(); useEffect(()=>{ @@ -86,6 +87,8 @@ export default Form.create()(({ form, history, showNotification, projectDetail, // 保存wiki文件,包括新增和修改 function saveFile() { + if(operateFlag) return; + setOperateFlag(true); validateFields((err, values) => { if (!err) { let regEn = /[\[\]`\/:*?''<>|%-+_]/g; @@ -101,7 +104,10 @@ export default Form.create()(({ form, history, showNotification, projectDetail, pagename: wikiName, ...values, commit_message: '', - }).then(res => dealRes(res)); + }).then(res => { + dealRes(res); + setOperateFlag(false); + }); } else { if (Array.isArray(fileArrInit)) { for (const item of fileArrInit) { @@ -118,7 +124,10 @@ export default Form.create()(({ form, history, showNotification, projectDetail, pagename: values.name, ...values, commit_message: '', - }).then(res => dealRes(res)); + }).then(res =>{ + dealRes(res); + setOperateFlag(false); + }); } } })