|
|
@@ -45,22 +45,26 @@ const errorHandler = (error) => {
|
|
|
if (error.response.status === 403) {
|
|
|
notification.error({
|
|
|
message: '提示',
|
|
|
- description: data.errors
|
|
|
+ description: data.message
|
|
|
})
|
|
|
- if (token) {
|
|
|
+ // if (token) {
|
|
|
store.dispatch('Logout').then(() => {
|
|
|
setTimeout(() => {
|
|
|
- window.location.reload()
|
|
|
+ if (router.currentRoute.path !== '/user/login') {
|
|
|
+ router.replace({ path: '/user/login' }).catch(() => {
|
|
|
+ // 静默处理导航错误
|
|
|
+ })
|
|
|
+ }
|
|
|
}, 1500)
|
|
|
})
|
|
|
- }else{
|
|
|
- // 使用 replace 避免历史记录问题
|
|
|
- if (router.currentRoute.path !== '/user/login') {
|
|
|
- router.replace({ path: '/user/login' }).catch(() => {
|
|
|
- // 静默处理导航错误
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ // }else{
|
|
|
+ // // 使用 replace 避免历史记录问题
|
|
|
+ // if (router.currentRoute.path !== '/user/login') {
|
|
|
+ // router.replace({ path: '/user/login' }).catch(() => {
|
|
|
+ // // 静默处理导航错误
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
|