|
@@ -18,7 +18,7 @@ const http = axios.create({
|
|
|
|
|
|
// --------打包或线上环境接口需要加上api/
|
|
|
baseURL: baseURL + "/api/",
|
|
|
- timeout: 20000,
|
|
|
+ timeout: 5000,
|
|
|
});
|
|
|
|
|
|
let axajInd = 0;
|
|
@@ -42,10 +42,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) {
|
|
@@ -71,10 +67,9 @@ http.interceptors.response.use(
|
|
|
async function (err) {
|
|
|
axajInd = 0;
|
|
|
store.dispatch({ type: "login/asyncLoding", payload: false });
|
|
|
-
|
|
|
- // 响应错误也要取消 上传文件的进度条
|
|
|
- UpAsyncLodingDom.style.opacity = 0;
|
|
|
- progressDom.style.width = "0%";
|
|
|
+ // 上传附件的进度条
|
|
|
+ const UpAsyncLodingDom: any = document.querySelector("#UpAsyncLoding");
|
|
|
+ const progressDom: any = document.querySelector("#progress");
|
|
|
|
|
|
// 如果因为网络原因,response没有,给提示消息
|
|
|
if (!err.response) {
|
|
@@ -82,6 +77,9 @@ http.interceptors.response.use(
|
|
|
} else {
|
|
|
message.warning("错误!");
|
|
|
}
|
|
|
+ // 响应错误也要取消 上传文件的进度条
|
|
|
+ UpAsyncLodingDom.style.opacity = 0;
|
|
|
+ progressDom.style.width = "0%";
|
|
|
|
|
|
return Promise.reject(err);
|
|
|
}
|