|
@@ -6,7 +6,7 @@ import getOrigin from '/@/utils/origin'
|
|
const service = axios.create({
|
|
const service = axios.create({
|
|
baseURL: getOrigin(import.meta.env.VITE_ICE104_API),
|
|
baseURL: getOrigin(import.meta.env.VITE_ICE104_API),
|
|
// baseURL: 'http://jfg4xi.natappfree.cc',
|
|
// baseURL: 'http://jfg4xi.natappfree.cc',
|
|
- timeout: 50000,
|
|
|
|
|
|
+ timeout: 120000,
|
|
headers: { 'Content-Type': 'application/json' },
|
|
headers: { 'Content-Type': 'application/json' },
|
|
});
|
|
});
|
|
|
|
|
|
@@ -68,6 +68,7 @@ service.interceptors.response.use(
|
|
}
|
|
}
|
|
},
|
|
},
|
|
(error) => {
|
|
(error) => {
|
|
|
|
+ ElMessage.closeAll()
|
|
// 对响应错误做点什么
|
|
// 对响应错误做点什么
|
|
if (error.message.indexOf('timeout') != -1) {
|
|
if (error.message.indexOf('timeout') != -1) {
|
|
ElMessage.error('网络超时');
|
|
ElMessage.error('网络超时');
|
|
@@ -124,14 +125,14 @@ export function file(url: string, params?: any, method: 'get' | 'post' = 'get'):
|
|
url,
|
|
url,
|
|
method,
|
|
method,
|
|
params,
|
|
params,
|
|
- timeout: 30000,
|
|
|
|
|
|
+ timeout: 120000,
|
|
responseType: 'arraybuffer',
|
|
responseType: 'arraybuffer',
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
return service({
|
|
return service({
|
|
url,
|
|
url,
|
|
method,
|
|
method,
|
|
- timeout: 100000,
|
|
|
|
|
|
+ timeout: 120000,
|
|
data: params,
|
|
data: params,
|
|
responseType: 'blob',
|
|
responseType: 'blob',
|
|
});
|
|
});
|