From 6e65dd1b8b1a860ba4f2594dea8b72bf7655b5e7 Mon Sep 17 00:00:00 2001 From: gtz217 <535262213@qq.com> Date: Fri, 5 Aug 2022 09:57:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E3=80=81=E8=B6=85=E6=97=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/material/material-edit.vue | 4 +++- src/util/request.js | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/pages/material/material-edit.vue b/src/pages/material/material-edit.vue index cd47cc8..66ad32a 100644 --- a/src/pages/material/material-edit.vue +++ b/src/pages/material/material-edit.vue @@ -2,7 +2,7 @@ * @Author: gtz * @Date: 2022-07-28 10:22:30 * @LastEditors: gtz - * @LastEditTime: 2022-08-04 14:56:10 + * @LastEditTime: 2022-08-05 09:55:48 * @Description: file content * @FilePath: \hf-pda\src\pages\material\material-edit.vue --> @@ -197,6 +197,7 @@ export default { materialDateId: null, materialDateName: null, materialDateCode: null, + materialId: null, materialName: null, materialCode: null, replaceTime: null, @@ -336,6 +337,7 @@ export default { materialDateId: null, materialDateName: null, materialDateCode: null, + materialId: null, materialName: null, materialCode: null, replaceTime: null, diff --git a/src/util/request.js b/src/util/request.js index f9b89fd..c2d96c7 100644 --- a/src/util/request.js +++ b/src/util/request.js @@ -2,7 +2,7 @@ * @Author: gtz * @Date: 2022-07-25 14:18:00 * @LastEditors: gtz - * @LastEditTime: 2022-08-04 15:55:01 + * @LastEditTime: 2022-08-05 09:56:34 * @Description: file content * @FilePath: \hf-pda\src\util\request.js */ @@ -19,11 +19,20 @@ let toast = null // token加入header service.interceptors.request.use((config) => { // console.log(store.state) - toast = Toast.loading({ - mask: true, - message: '加载中...', - duration: 5000 - }) + if (config.responseType) { + config.timeout = 15000 + toast = Toast.loading({ + mask: true, + message: '加载中...', + duration: 15000 + }) + } else { + toast = Toast.loading({ + mask: true, + message: '加载中...', + duration: 5000 + }) + } // if (config.url !== '/wms/login/verify' && JSON.parse(sessionStorage.getItem('userInfo')).token) { // config.headers['token'] = JSON.parse(sessionStorage.getItem('userInfo')).token // } @@ -77,9 +86,7 @@ service.interceptors.response.use( error => { toast.clear() toast = null - if (error.response) { - Toast.fail('网络异常') - } + Toast.fail('网络超时') return Promise.reject(error) // 返回接口返回的错误信息 // return Promise.reject(error.response.data) // 返回接口返回的错误信息 })