优化token过期,页面未跳转到登录页

This commit is contained in:
zCans
2022-11-29 16:10:31 +08:00
parent 2dc8f3c141
commit d12946c937
+1 -1
View File
@@ -34,7 +34,7 @@ service.interceptors.response.use(
type: 'error',
duration: 5 * 1000
})
if (res.code === 4 && !window.location.href.endsWith('#/login')) {
if ((res.code === 4 || res.code === 1) && !window.location.href.endsWith('#/login')) {
store.dispatch('FedLogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
})