diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 7211fde5e..1731064c0 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -139,21 +139,20 @@ class PathDetailIndex extends Component{ let pathid=this.props.match.params.pathId; let url="/paths/"+pathid+".json"; axios.get(url).then((result)=>{ - if (result.data.status == 407 || result.data.status == 401) { + if (result.data.status === 407 || result.data.status === 401) { return; } - if(result.data.allow_visit===true){ - this.setState({ - detailInfoList:result.data, - items: getItems(result.data.members.length), - }) - }else{ - window.location.href = "/403"; - // this.setState({ - // Modalstype:true, - // Modalstopval:'你没有权限访问,请联系对应课程管理人员开通', - // }) - } + + if (result.data.status === 403) { + return; + } + + if(result.data.allow_visit===true){ + this.setState({ + detailInfoList:result.data, + items: getItems(result.data.members.length), + }) + } }).catch((error)=>{ console.log(error); @@ -168,6 +167,9 @@ class PathDetailIndex extends Component{ if (result.data.status == 407 || result.data.status == 401) { return; } + if (result.data.status === 403 ) { + return; + } if(result.data.allow_visit===true){ this.setState({ @@ -175,13 +177,8 @@ class PathDetailIndex extends Component{ items: getItems(result.data.members.length), user_id:undefined, }) - }else{ - window.location.href = "/403"; - // this.setState({ - // Modalstype:true, - // Modalstopval:'你没有权限访问,请联系对应课程管理人员开通', - // }) } + }).catch((error)=>{ console.log(error); })