permission有为空的情况

This commit is contained in:
caishi 2021-07-06 14:39:01 +08:00
parent 3b31b5c47b
commit 8b1b61031a
2 changed files with 1 additions and 4 deletions

View File

@ -255,7 +255,7 @@ function CoderDepot(props){
const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
const { current_user } = props;
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && (projectDetail.permission !=="Reporter" || (current_user && current_user.admin));
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
return(
<WhiteBack>
<UpdateDescModal desc={desc} website={website} lesson_url={lesson_url} visible={openModal} onCancel={()=>setOpenModal(false)} onOk={okUpdate}/>

View File

@ -154,9 +154,6 @@ export function TPMIndexHOC(WrappedComponent) {
this.setState({
tpmLoading: false
})
if (this.props.match.path === "/" && response.data.login) {
this.props.history.push(`/users/${response.data.login}`);
}
if(response.data && response.data.login){
if(!response.data.has_gitea_user || (response.data.has_gitea_user && !response.data.is_sync_pwd)){
this.setState({