mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-16 16:34:24 +02:00
Reject when connection failed
This commit is contained in:
@@ -31,6 +31,10 @@ ax.interceptors.response.use(
|
|||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
async (err) => {
|
async (err) => {
|
||||||
|
if (!err.response) {
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
|
|
||||||
if (err.response && err.response.status === 401) {
|
if (err.response && err.response.status === 401) {
|
||||||
const { config } = err;
|
const { config } = err;
|
||||||
|
|
||||||
@@ -55,10 +59,6 @@ ax.interceptors.response.use(
|
|||||||
return Axios(config);
|
return Axios(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (err.response.data.error.message === 'No auth token') {
|
|
||||||
// auth.logout();
|
|
||||||
// }
|
|
||||||
|
|
||||||
auth.logout();
|
auth.logout();
|
||||||
}
|
}
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user