Commit 647c8726 by zhaochengxiang

超时提示

parent b7084f23
......@@ -29,6 +29,8 @@ function* request(args) {
if (ex?.ApiError?.cnMessage) {
showErrorNotifaction('温馨提示', ex.ApiError.cnMessage, 5);
}
} else if ((ex?.message||'').indexOf('timeout') !== -1 && (ex?.message||'').indexOf('exceeded') !== -1) {
showErrorNotifaction('温馨提示', '请求超时。', 5);
} else {
showErrorNotifaction('温馨提示', '连接失败,当前页面加载异常。', 5);
}
......
......@@ -9,7 +9,7 @@ const baseURL = '/api/';
const instance = axios.create({
baseURL,
timeout: 40000,
timeout: 300000,
headers: {
//'X-Custom-Header': 'rest',
'Cache-Control': 'no-cache,no-store,must-revalidate,max-age=-1,private'
......@@ -22,7 +22,7 @@ const instance = axios.create({
const instanceRow = axios.create({
baseURL: '',
timeout: 40000,
timeout: 300000,
headers: {
//'X-Custom-Header': 'rest',
'Cache-Control': 'no-cache,no-store,must-revalidate,max-age=-1,private'
......@@ -35,7 +35,7 @@ const instanceRow = axios.create({
const textplain = axios.create({
baseURL,
timeout: 40000,
timeout: 300000,
headers: {
//'X-Custom-Header': 'rest',
'Cache-Control': 'no-cache,no-store,must-revalidate,max-age=-1,private'
......@@ -81,7 +81,7 @@ textplain.interceptors.request.use(
const fileplain = axios.create({
baseURL,
timeout: 40000,
timeout: 300000,
headers:{'Content-Type':'multipart/form-data'},
processData:false,
validateStatus: (status) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment