From c69c80d43552098f331f3a19a20b295109c03471 Mon Sep 17 00:00:00 2001 From: zhengjie Date: Thu, 18 Apr 2019 11:13:56 +0800 Subject: [PATCH] =?UTF-8?q?1.7=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/index.scss | 2 +- src/utils/request.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/styles/index.scss b/src/styles/index.scss index 3a08658..165c90b 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -132,6 +132,6 @@ a:hover { height: 32px; width: 135px; display: block; - margin: 0 auto; + //margin: 0 auto; } } diff --git a/src/utils/request.js b/src/utils/request.js index 327a32a..9339366 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -45,9 +45,16 @@ service.interceptors.response.use( try { code = error.response.data.status } catch (e) { - if (error.toString().indexOf('timeout')) { + if (error.toString().indexOf('Error: timeout') !== -1) { Notification.error({ - title: '请求超时', + title: '请求超时,请重试', + duration: 2500 + }) + return Promise.reject(error) + } + if (error.toString().indexOf('Error: Network Error') !== -1) { + Notification.error({ + title: '网络错误,请联系网站管理员恢复', duration: 2500 }) return Promise.reject(error)