From f6b3def6b476e5d01208d8cf9d2ebc39bbd6f464 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 10 Mar 2023 13:46:39 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2665=20=20fix=EF=BC=9A=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=9C=A8=E4=BD=BF=E7=94=A8=E8=87=AA=E5=B7=B1=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=B6=E5=88=87=E6=8D=A2=E4=B8=BAadmin?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=EF=BC=8C=E7=99=BB=E5=BD=95=E5=90=8E=E4=BC=9A?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=B7=B3=E8=BD=AC=E8=87=B3=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=BD=93=E5=89=8D=E6=93=8D=E4=BD=9C=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/layout/header.vue | 5 +++-- nezha-fronted/src/store/user.js | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/layout/header.vue b/nezha-fronted/src/components/layout/header.vue index be1b4d6a6..f6e4b99bd 100644 --- a/nezha-fronted/src/components/layout/header.vue +++ b/nezha-fronted/src/components/layout/header.vue @@ -181,8 +181,9 @@ export default { logout () { this.$get('logout').then(() => { this.logoutSuccess() - // document.location.href = '/' - this.$router.push('/login') + document.location.href = '/' + sessionStorage.setItem('nz-is-logout', '1') + // this.$router.push('/login') }) }, showPinDialog () { diff --git a/nezha-fronted/src/store/user.js b/nezha-fronted/src/store/user.js index a4fbe05a8..24337fb59 100644 --- a/nezha-fronted/src/store/user.js +++ b/nezha-fronted/src/store/user.js @@ -144,7 +144,7 @@ const user = { }) } // 登录成功后跳回到原来页面 - if (sessionStorage.getItem('nz-previous-page') && noJumpPath.indexOf(sessionStorage.getItem('nz-previous-page')) === -1) { + if (sessionStorage.getItem('nz-previous-page') && noJumpPath.indexOf(sessionStorage.getItem('nz-previous-page')) === -1 && !sessionStorage.getItem('nz-is-logout')) { const route = sessionStorage.getItem('nz-previous-page') router.push({ path: route, @@ -153,9 +153,11 @@ const user = { } }).then(() => { sessionStorage.removeItem('nz-previous-page') + sessionStorage.removeItem('nz-is-logout') }) } else { sessionStorage.removeItem('nz-previous-page') + sessionStorage.removeItem('nz-is-logout') router.push({ path: path[0], query: {