优化token过期后登录跳转逻辑
This commit is contained in:
parent
e116897b7e
commit
52566c600a
@ -71,7 +71,8 @@ service.interceptors.response.use(
|
|||||||
if (!authorization || !authorization.refresh_token) {
|
if (!authorization || !authorization.refresh_token) {
|
||||||
const redirect = encodeURIComponent(window.location.href)
|
const redirect = encodeURIComponent(window.location.href)
|
||||||
router.push(`/login?redirect=${redirect}`)
|
router.push(`/login?redirect=${redirect}`)
|
||||||
|
// 清除token
|
||||||
|
store.dispatch('app/clearToken')
|
||||||
// 代码不要往后执行了
|
// 代码不要往后执行了
|
||||||
return Promise.reject(error)
|
return Promise.reject(error)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user