优化token过期后登录跳转逻辑

This commit is contained in:
ZSEN 2021-04-24 13:43:45 +08:00
parent e116897b7e
commit 52566c600a

View File

@ -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)
} }