📅  最后修改于: 2022-03-11 15:02:47.378000             🧑  作者: Mango
// Add a response interceptor
HTTP.interceptors.response.use(function (response) {
return response
}, function(error) {
if (error.response.status === 401) {
store.dispatch('logout')
router.push('/login')
}
return Promise.reject(error.response.data)
})