编辑权限

This commit is contained in:
caishi 2020-10-06 13:21:12 +08:00
parent ef465b1ce0
commit 36833232e3
1 changed files with 9 additions and 3 deletions

View File

@ -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){
<div className="aboutContent">
<AlignCenterBetween style={{padding:"14px 0px"}}>
<span className="font-16"><i className="iconfont icon-xiangmujianjie mr5 font-16 color-blue"></i>项目简介</span>
<a onClick={editContent} className="color-blue">编辑</a>
{ editOpration && <a onClick={editContent} className="color-blue">编辑</a> }
</AlignCenterBetween>
{
edit ?