From 9a32e37a0cd1aa04944e31fb7d5aebaf1607bd00 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 20 May 2022 17:26:07 +0800 Subject: [PATCH] =?UTF-8?q?readme=20=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E3=80=81=E6=98=BE=E7=A4=BA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9A=84=E5=AD=97=E6=AE=B5=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/forge/Main/CoderDepotReadme.jsx | 4 ++-- src/forge/Main/CoderRootFileDetail.js | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index fb7d4a25..0b88e895 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/forge/Main/CoderDepotReadme.jsx b/src/forge/Main/CoderDepotReadme.jsx index bb9bdd5b..586f57fb 100644 --- a/src/forge/Main/CoderDepotReadme.jsx +++ b/src/forge/Main/CoderDepotReadme.jsx @@ -11,8 +11,8 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){ const [ content ,setContent ] = useState(undefined); useEffect(()=>{ - if(readme && readme.content){ - setContent(readme.content); + if(readme && readme.replace_content){ + setContent(readme.replace_content); }else{ setContent(undefined); } diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index b73a2168..6213f448 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -21,7 +21,7 @@ class CoderRootFileDetail extends Component { value: undefined, language: undefined, languages: undefined, - description: props.detail.content, + description: props.detail.replace_content, menuList:undefined }; } @@ -36,12 +36,12 @@ class CoderRootFileDetail extends Component { }; componentDidUpdate=(prevProps)=>{ - const { content } = this.props && this.props.detail; - const prevcontent = prevProps.detail && prevProps.detail.content; - if (content && prevcontent) { - if (prevcontent !== content){ + const { replace_content } = this.props && this.props.detail; + const prevcontent = prevProps.detail && prevProps.detail.replace_content; + if (replace_content && prevcontent) { + if (prevcontent !== replace_content){ this.setState({ - description: content + description: replace_content }); } } @@ -319,7 +319,7 @@ class CoderRootFileDetail extends Component { {...this.state} language={language ? language : "javascript"} filepath={`/${detail.path}`} - content={description} + content={detail.content} readOnly={readOnly} editorType="update" currentBranch={currentBranch}