|
@@ -69,8 +69,13 @@ request.interceptors.request.use(
|
|
|
|
|
|
request.interceptors.response.use(
|
|
request.interceptors.response.use(
|
|
async res => {
|
|
async res => {
|
|
|
|
+ toast = setTimeout(() => {
|
|
|
|
+ closeToast();
|
|
|
|
+ }, 100);
|
|
|
|
+
|
|
if (res.status > 299 || res.status < 200) {
|
|
if (res.status > 299 || res.status < 200) {
|
|
const msg = '服务器错误,状态码' + res.status;
|
|
const msg = '服务器错误,状态码' + res.status;
|
|
|
|
+ clearTimeout(toast);
|
|
showToast(msg);
|
|
showToast(msg);
|
|
throw new Error(msg);
|
|
throw new Error(msg);
|
|
}
|
|
}
|
|
@@ -87,9 +92,7 @@ request.interceptors.response.use(
|
|
}
|
|
}
|
|
if (!(data.code === 403 || data.code === 5000)) {
|
|
if (!(data.code === 403 || data.code === 5000)) {
|
|
clearTimeout(toast);
|
|
clearTimeout(toast);
|
|
- setTimeout(() => {
|
|
|
|
- showToast(msg);
|
|
|
|
- }, 20);
|
|
|
|
|
|
+ showToast(msg);
|
|
}
|
|
}
|
|
const browserInfo = browser();
|
|
const browserInfo = browser();
|
|
if (data.code === 5000 || data.code === 403) {
|
|
if (data.code === 5000 || data.code === 403) {
|