Commit 647c8726 by zhaochengxiang

超时提示

parent b7084f23
...@@ -29,6 +29,8 @@ function* request(args) { ...@@ -29,6 +29,8 @@ function* request(args) {
if (ex?.ApiError?.cnMessage) { if (ex?.ApiError?.cnMessage) {
showErrorNotifaction('温馨提示', ex.ApiError.cnMessage, 5); showErrorNotifaction('温馨提示', ex.ApiError.cnMessage, 5);
} }
} else if ((ex?.message||'').indexOf('timeout') !== -1 && (ex?.message||'').indexOf('exceeded') !== -1) {
showErrorNotifaction('温馨提示', '请求超时。', 5);
} else { } else {
showErrorNotifaction('温馨提示', '连接失败,当前页面加载异常。', 5); showErrorNotifaction('温馨提示', '连接失败,当前页面加载异常。', 5);
} }
......
...@@ -9,7 +9,7 @@ const baseURL = '/api/'; ...@@ -9,7 +9,7 @@ const baseURL = '/api/';
const instance = axios.create({ const instance = axios.create({
baseURL, baseURL,
timeout: 40000, timeout: 300000,
headers: { headers: {
//'X-Custom-Header': 'rest', //'X-Custom-Header': 'rest',
'Cache-Control': 'no-cache,no-store,must-revalidate,max-age=-1,private' 'Cache-Control': 'no-cache,no-store,must-revalidate,max-age=-1,private'
...@@ -22,7 +22,7 @@ const instance = axios.create({ ...@@ -22,7 +22,7 @@ const instance = axios.create({
const instanceRow = axios.create({ const instanceRow = axios.create({
baseURL: '', baseURL: '',
timeout: 40000, timeout: 300000,
headers: { headers: {
//'X-Custom-Header': 'rest', //'X-Custom-Header': 'rest',
'Cache-Control': 'no-cache,no-store,must-revalidate,max-age=-1,private' 'Cache-Control': 'no-cache,no-store,must-revalidate,max-age=-1,private'
...@@ -35,7 +35,7 @@ const instanceRow = axios.create({ ...@@ -35,7 +35,7 @@ const instanceRow = axios.create({
const textplain = axios.create({ const textplain = axios.create({
baseURL, baseURL,
timeout: 40000, timeout: 300000,
headers: { headers: {
//'X-Custom-Header': 'rest', //'X-Custom-Header': 'rest',
'Cache-Control': 'no-cache,no-store,must-revalidate,max-age=-1,private' 'Cache-Control': 'no-cache,no-store,must-revalidate,max-age=-1,private'
...@@ -81,7 +81,7 @@ textplain.interceptors.request.use( ...@@ -81,7 +81,7 @@ textplain.interceptors.request.use(
const fileplain = axios.create({ const fileplain = axios.create({
baseURL, baseURL,
timeout: 40000, timeout: 300000,
headers:{'Content-Type':'multipart/form-data'}, headers:{'Content-Type':'multipart/form-data'},
processData:false, processData:false,
validateStatus: (status) => { 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