From 36833232e32ccd02d1ad0de1a795f8a3072b8d1e Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 6 Oct 2020 13:21:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/About/Index.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/forge/About/Index.jsx b/src/forge/About/Index.jsx index 77936fe0..b0d22f9d 100644 --- a/src/forge/About/Index.jsx +++ b/src/forge/About/Index.jsx @@ -14,15 +14,21 @@ function Index(props){ const [ content , setContent ] = useState(undefined); const [ edit , setEdit ] = useState(false); const [ fileList , setFileList ] = useState(undefined); - + const [ editOpration , setEditOpration ] = useState(false); const { owner , projectsId } = props.match.params; - console.log(props.match.params); + + const { isManager , isDeveloper } = props; useEffect(()=>{ if(owner&&projectsId){ Init(); } },[owner,projectsId]) + useEffect(()=>{ + if(isManager === true || isDeveloper === true){ + setEditOpration(true); + } + },[isManager , isDeveloper]) function Init(){ const url = `/${owner}/${projectsId}/about.json`; axios.get(url).then(result=>{ @@ -64,7 +70,7 @@ function Index(props){