From 416c8df729cef3fee5c03dca2d659ad59d6bcbf3 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Tue, 29 Sep 2020 11:52:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3token=E5=A4=B1=E6=95=88=20?= =?UTF-8?q?=EF=BC=8C=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ant-design-vue-jeecg/src/utils/request.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ant-design-vue-jeecg/src/utils/request.js b/ant-design-vue-jeecg/src/utils/request.js index d4bcb601..d3b7009d 100644 --- a/ant-design-vue-jeecg/src/utils/request.js +++ b/ant-design-vue-jeecg/src/utils/request.js @@ -32,13 +32,9 @@ const err = (error) => { notification.error({ message: '系统提示', description: '拒绝访问',duration: 4}) break case 500: - let path = window.location.href //notification.error({ message: '系统提示', description:'Token失效,请重新登录!',duration: 4}) - if(token && data.message.includes("Token失效") && path.indexOf('/user/login') < 0){ + if(token && data.message.includes("Token失效")){ // update-begin- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式,不直接跳转---- - // store.dispatch('Logout').then(() => { - // window.location.reload() - // }) Modal.error({ title: '登录已过期', content: '很抱歉,登录已过期,请重新登录', @@ -48,7 +44,9 @@ const err = (error) => { store.dispatch('Logout').then(() => { Vue.ls.remove(ACCESS_TOKEN) try { - if(path.indexOf('/user/login')==-1){ + let path = window.document.location.pathname + console.log("location pathname -> "+path) + if(path!="/" && path.indexOf('/user/login')==-1){ window.location.reload() } }catch (e) {