Browse Source

请求拦截错误处理

master
qqkj 5 years ago
parent
commit
87f091492d
  1. 3
      src/utils/request.js

3
src/utils/request.js

@ -49,7 +49,7 @@ service.interceptors.response.use(
response => { response => {
if(response.data && response.data.tips && response.data.tips.msg == 'Full authentication is required to access this resource'){ if(response.data && response.data.tips && response.data.tips.msg == 'Full authentication is required to access this resource'){
Message.error('会话过期,请重新登陆') Message.error('会话过期,请重新登陆')
response.data.tips.msg="会话过期,请重新登陆";
//response.data.tips.msg="会话过期,请重新登陆";
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
router.replace({path: '/login'}) router.replace({path: '/login'})
}) })
@ -66,6 +66,7 @@ service.interceptors.response.use(
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
router.replace({path: '/login'}) router.replace({path: '/login'})
}) })
return;
} }
} }

Loading…
Cancel
Save