From 221ec8f076988c961e513df50fb4a3fb66ed350c Mon Sep 17 00:00:00 2001 From: hyx Date: Wed, 18 May 2022 17:04:27 +0800 Subject: [PATCH] =?UTF-8?q?CN-484=20=E4=BA=A4=E4=BA=92=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=9A=E7=99=BB=E5=BD=95=E6=8B=A6=E6=88=AA=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E7=99=BB=E5=BD=95=E6=88=90=E5=8A=9F=E5=90=8E=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=8E=9Furl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Login.vue | 2 +- src/permission.js | 3 +++ src/utils/constants.js | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Login.vue b/src/Login.vue index 19619264..8455effb 100644 --- a/src/Login.vue +++ b/src/Login.vue @@ -77,7 +77,7 @@ export default { if (!this.$_.isEmpty(res.data.theme)) { localStorage.setItem(storageKey.theme, res.data.theme) } - res.loginSuccessPath = this.loginSuccessPath + res.loginSuccessPath = this.loginSuccessPath ? this.loginSuccessPath : localStorage.getItem(storageKey.tokenExpireCurrentPath) this.loginSuccess(res) localStorage.setItem(storageKey.username, this.username) } else if (res.code === 518005) { diff --git a/src/permission.js b/src/permission.js index 5648abfa..b728ae09 100644 --- a/src/permission.js +++ b/src/permission.js @@ -11,6 +11,9 @@ const loginWhiteList = ['/login', '/'] // 免登陆白名单 const permissionWhiteList = [...loginWhiteList, '/entityDetail'] // 权限白名单 router.beforeEach(async (to, from, next) => { + if (to.path.indexOf('/login') == -1) { + localStorage.setItem(storageKey.tokenExpireCurrentPath, to.fullPath) + } // 加载iso-3166-2资源 loadGeoData() // 加载baseUrl diff --git a/src/utils/constants.js b/src/utils/constants.js index 470e8fea..55b4e4d8 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -24,7 +24,8 @@ export const storageKey = { unsavedChange: 'cn-unsaved-change', entitySearchHistory: 'cn-entity-search-history', echartLegendFontSize: 'echartLegendFontSize', - echartLabelFontSize: 'echartLabelFontSize' + echartLabelFontSize: 'echartLabelFontSize', + tokenExpireCurrentPath: 'token-expire-current-path' } // 统一定义跳转来源