仅管理员有权限进行编辑
This commit is contained in:
parent
9db1905705
commit
7cdf66f911
|
|
@ -14,9 +14,10 @@ function Index(props){
|
|||
const [ content , setContent ] = useState(undefined);
|
||||
const [ edit , setEdit ] = useState(false);
|
||||
const [ fileList , setFileList ] = useState(undefined);
|
||||
const [ editOpration , setEditOpration ] = useState(false);
|
||||
// const [ editOpration , setEditOpration ] = useState(false);
|
||||
const { owner , projectsId } = props.match.params;
|
||||
const { isManager , isDeveloper , current_user, projectDetail } = props;
|
||||
const editOpration = current_user && current_user.login && isManager
|
||||
|
||||
useEffect(()=>{
|
||||
if(owner && projectsId && projectDetail){
|
||||
|
|
@ -25,11 +26,11 @@ function Index(props){
|
|||
}
|
||||
},[owner,projectsId, projectDetail])
|
||||
|
||||
useEffect(()=>{
|
||||
if( (current_user && current_user.login) && (isManager === true || isDeveloper === true)){
|
||||
setEditOpration(true);
|
||||
}
|
||||
},[isManager , isDeveloper])
|
||||
// useEffect(()=>{
|
||||
// if( (current_user && current_user.login) && (isManager === true || isDeveloper === true)){
|
||||
// setEditOpration(true);
|
||||
// }
|
||||
// },[isManager , isDeveloper])
|
||||
function Init(){
|
||||
const url = `/${owner}/${projectsId}/about.json`;
|
||||
axios.get(url).then(result=>{
|
||||
|
|
|
|||
Loading…
Reference in New Issue