Axios响应拦截器由文档中的以下内容定义
// Add a response interceptor
axios.interceptors.response.use(function (response) {
// Do something with response data
return response;
}, function (error) {
// Do something with response error
return Promise.reject(error);
});
但是什么时候调用这些函数都没有提及。
我知道在没有错误的情况下调用第一个函数,在有错误的情况下调用第二个函数。
但是这种响应会被认为是有错误,文档中对此没有任何提及。