From 620dbd461e417dee210b4177fd8442d56aacad76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 24 Jul 2019 14:13:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../paths/PathDetail/PathDetailIndex.js | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) 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); })