mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-22 12:58:55 +08:00
⚡ 优化。 401 重定向首页
This commit is contained in:
parent
841d835474
commit
b99e787afc
@ -56,6 +56,13 @@ axios.interceptors.response.use(data => {
|
||||
message: errorCode[code] || errorCode['default'],
|
||||
type: 'error'
|
||||
})
|
||||
|
||||
if (parseInt(code) === 401) {
|
||||
store.dispatch('FedLogOut').then(() => {
|
||||
router.push({ path: '/login' })
|
||||
})
|
||||
}
|
||||
|
||||
return Promise.reject(new Error(error))
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user