From 118456018835e71f328cfb0e15bc71ff32dae736 Mon Sep 17 00:00:00 2001 From: wyx <51903@qq.com> Date: Fri, 17 Mar 2023 15:25:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=A1=B5=E9=9D=A2=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=88=A4=E6=96=AD=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/config.js | 2 ++ src/router/index.js | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/api/config.js b/src/api/config.js index d2d9e197..0130bcf3 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -61,6 +61,8 @@ http.interceptors.response.use( (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'alpine') ? router.push({path: 'login', query: { returnUrl: router.currentRoute.value.fullPath }}) : (window.location.href = process.env.VUE_APP_LOGIN_URL + encodeURIComponent(window.location.protocol + process.env.VUE_APP_BOE_API_URL + process.env.VUE_APP_BASE + router.currentRoute.value.fullPath)) + // TODO token过期后退出登录 清空当前用户标记 - 为了刷新页面使用 + localStorage.removeItem('refreshPage') return Promise.reject(response); } show && message.error(msg); diff --git a/src/router/index.js b/src/router/index.js index d7a2556a..d5c57254 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -33,9 +33,15 @@ const timers = setInterval(() => { if(pathArr.length!==0){ // 刷新界面是否重新执行 if(pathArr.indexOf(currentPath)==-1){ + if(localStorage.getItem("refreshPage") == "jumpverify"){ + clearInterval(timers) + return + } clearInterval(timers) router.push({path: pathArr[0]}) + localStorage.setItem("refreshPage", "jumpverify") }else{ + localStorage.setItem("refreshPage", "jumpverify") clearInterval(timers) } }