From c0f1ae75d83074fff446274fa6a9964eeed77052 Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Wed, 12 Jan 2022 09:33:04 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8D=20=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=BF=87=E6=9C=9F=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E4=B8=A4?= =?UTF-8?q?=E6=AC=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++-- src/utils/request.js | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1e96214..d4dc158 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -180,4 +180,5 @@ FIX ## v1.2.2F `2021年1月12日` FIX -- 修复 登录过期没有跳转到登录界面的问题 \ No newline at end of file +- 修复 登录过期没有跳转到登录界面的问题 +- 修复 登录过期错误提示两次的问题 \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index ad4138c..4868558 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,7 +1,7 @@ /* * @Date: 2021-12-08 15:59:46 * @LastEditors: JinxChen - * @LastEditTime: 2022-01-12 09:18:37 + * @LastEditTime: 2022-01-12 09:31:21 * @FilePath: \GpsCardAdmin\src\utils\request.js * @description: */ @@ -68,14 +68,14 @@ service.interceptors.response.use( setTimeout(() => { store.dispatch('user/resetToken').then(() => { Message({ - message: 'token过期,请重新登录', + message: '登录过期,请您重新登录!', type: 'error', duration: 1500 }) location.reload() }) - }, 1500) - return Promise.reject(new Error('token过期,请重新登录')) + }, 1000) + /* return Promise.reject(new Error('token过期,请重新登录')) */ } else if (res.code === 0) { return res } else { @@ -88,7 +88,7 @@ service.interceptors.response.use( } }, error => { - console.log('err' + error) // for debug + console.log('err:', error) // for debug Message({ message: error.message, type: 'error',