📜  axios.interceptors.response.use - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:47.378000             🧑  作者: Mango

代码示例1
// 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)
})