instance.interceptors.response.use(
(response) => {
return response;
},
(error) => {
if (!error.response) {
alert("NETWORK ERROR");
} else {
const code = error.response.status;
const originalRequest = error.config;
if (code === 401 && !originalRequest._retry) {
console.error("跳转到登录页");
}
return Promise.reject(error);
}
}
);