|
@@ -58,14 +58,13 @@ async response => {
|
|
|
|
|
|
// 401:未登录;
|
|
|
if (res.code === 401 || res.code === 403) {
|
|
|
- console.log(location,'401/403')
|
|
|
+
|
|
|
// 清理缓存 跳到登录页面
|
|
|
try{
|
|
|
await store.dispatch('FedLogOut')
|
|
|
await router.push('/login')
|
|
|
location.reload(true)
|
|
|
}catch(e){
|
|
|
- console.log(e,'报错')
|
|
|
}
|
|
|
|
|
|
|
|
@@ -79,12 +78,19 @@ async response => {
|
|
|
|
|
|
|
|
|
// })
|
|
|
+ Message({
|
|
|
+ message: '登录超时,请重新登录',
|
|
|
+ type: 'error',
|
|
|
+ duration: 3 * 1000
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ Message({
|
|
|
+ message: res.msg||res.message,
|
|
|
+ type: 'error',
|
|
|
+ duration: 3 * 1000
|
|
|
+ })
|
|
|
}
|
|
|
- Message({
|
|
|
- message: res.msg||res.message,
|
|
|
- type: 'error',
|
|
|
- duration: 3 * 1000
|
|
|
- })
|
|
|
+
|
|
|
return Promise.reject(res.msg||res.message)
|
|
|
} else {
|
|
|
return response.data
|