shaogen1995 2 lat temu
rodzic
commit
079e858f36
1 zmienionych plików z 13 dodań i 11 usunięć
  1. 13 11
      houtai/src/utils/http.ts

+ 13 - 11
houtai/src/utils/http.ts

@@ -74,17 +74,19 @@ http.interceptors.response.use(
     return response.data;
   },
   async function (err) {
-    axajInd = 0;
-    domShowFu("#AsyncSpinLoding", false);
-
-    // 如果因为网络原因,response没有,给提示消息
-    if (!err.response) {
-      if (store.getState().loginStore.closeUpFile.state)
-        MessageFu.warning("网络超时或中止上传!");
-      else MessageFu.warning("网络繁忙,请稍后重试!");
-    } else {
-      MessageFu.warning("错误!");
-    }
+    clearTimeout(timeId);
+    timeId = window.setTimeout(() => {
+      axajInd = 0;
+      domShowFu("#AsyncSpinLoding", false);
+      // 如果因为网络原因,response没有,给提示消息
+      if (!err.response) {
+        if (store.getState().loginStore.closeUpFile.state)
+          MessageFu.warning("网络超时或中止上传!");
+        else MessageFu.error("网络繁忙,请稍后重试!");
+      } else {
+        MessageFu.error("响应错误,请联系管理员!");
+      }
+    }, 100);
 
     // 响应错误也要取消 上传文件的进度条
     domShowFu("#UpAsyncLoding", false);