仅管理员有权限进行编辑

This commit is contained in:
谢思 2024-03-16 14:14:32 +08:00
parent 9db1905705
commit 7cdf66f911
1 changed files with 7 additions and 6 deletions

View File

@ -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=>{