diff --git a/src/assets/api.js b/src/assets/api.js index 0fe7a354..d524b01c 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -90,21 +90,24 @@ const req = (method, url, params, responseType) => { if(res.status==200){ return res.json() }else{ - console.log(res); switch (res.status) { // 401: 未登录 case 401: - Notify.clear(); - Notify.error( "没有权限"); - break; - case 403: - Notify.clear(); - Notify.error( "用户登录已失效,请重新登录"); - sessionStorage.clear(); - setTimeout(() => { - window.location.href='/login'; - }, 2000) - break; + res.json().then(response =>{ + if(response.code==403){ + Notify.clear(); + Notify.error(response.message); + setTimeout(() => { + window.location.href='/login'; + }, 2000) + }else if(response.code==401){ + Notify.clear(); + Notify.error(response.message); + } + } + ).catch(); + + break; } } diff --git a/src/pages/home/home.js b/src/pages/home/home.js index 85d2b2cf..c7348163 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -203,6 +203,8 @@ export default class App extends Component { window.document.addEventListener('mouseover',function(){ window["mydata"].setState({lastTime:new Date().getTime()}); //更新操作时间 }); + //根据权限菜单进行匹配 + // timerstop=window.setInterval( window["mydata"].testTime, 1000); } // testTime(){ @@ -247,10 +249,11 @@ export default class App extends Component { this.setState({pathname:'/extension'})}>推广 */} -
帮助中心
+
帮助中心
{/* 用户头像信息 */}
+ {/* 帮助中心 */} {/* {!this.state.userInfo.head? { props.history.push('/home/plan-list') },1000);