|
@@ -10,7 +10,7 @@ export const baseURL =
|
|
|
// ? "http://192.168.20.55:8038/api/"
|
|
|
// : "";
|
|
|
process.env.NODE_ENV === "development" ? "https://xuzhouwall.4dage.com" : "";
|
|
|
- // process.env.NODE_ENV === "development" ? "http://192.168.20.55:8039" : "";
|
|
|
+// process.env.NODE_ENV === "development" ? "http://192.168.20.55:8039" : "";
|
|
|
|
|
|
// 创建 axios 实例
|
|
|
const http = axios.create({
|
|
@@ -19,7 +19,7 @@ const http = axios.create({
|
|
|
|
|
|
// --------打包或线上环境接口需要加上api/
|
|
|
baseURL: baseURL + "/api/",
|
|
|
- timeout: 30000,
|
|
|
+ timeout: 5000,
|
|
|
});
|
|
|
|
|
|
let axajInd = 0;
|
|
@@ -43,10 +43,6 @@ http.interceptors.request.use(
|
|
|
|
|
|
let timeId = -1;
|
|
|
|
|
|
-// 上传附件的进度条
|
|
|
-const UpAsyncLodingDom: any = document.querySelector("#UpAsyncLoding");
|
|
|
-const progressDom: any = document.querySelector("#progress");
|
|
|
-
|
|
|
// 响应拦截器
|
|
|
http.interceptors.response.use(
|
|
|
function (response) {
|
|
@@ -73,17 +69,19 @@ http.interceptors.response.use(
|
|
|
axajInd = 0;
|
|
|
store.dispatch({ type: "login/asyncLoding", payload: false });
|
|
|
|
|
|
- // 响应错误也要取消 上传文件的进度条
|
|
|
- if(UpAsyncLodingDom) UpAsyncLodingDom.style.opacity = 0;
|
|
|
- if(progressDom) progressDom.style.width = "0%";
|
|
|
-
|
|
|
+ // 上传附件的进度条
|
|
|
+ const UpAsyncLodingDom: any = document.querySelector("#UpAsyncLoding");
|
|
|
+ const progressDom: any = document.querySelector("#progress");
|
|
|
+
|
|
|
// 如果因为网络原因,response没有,给提示消息
|
|
|
if (!err.response) {
|
|
|
message.warning("网络繁忙,请稍后重试!");
|
|
|
} else {
|
|
|
message.warning("错误!");
|
|
|
}
|
|
|
-
|
|
|
+ // 响应错误也要取消 上传文件的进度条
|
|
|
+ if (UpAsyncLodingDom) UpAsyncLodingDom.style.opacity = 0;
|
|
|
+ if (progressDom) progressDom.style.width = "0%";
|
|
|
return Promise.reject(err);
|
|
|
}
|
|
|
);
|