优化。 401 重定向首页

This commit is contained in:
冷冷 2018-11-09 11:37:14 +08:00
parent 841d835474
commit b99e787afc

View File

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