diff --git a/nezha-fronted/src/components/layout/header.vue b/nezha-fronted/src/components/layout/header.vue index 355055142..2c4873bc4 100644 --- a/nezha-fronted/src/components/layout/header.vue +++ b/nezha-fronted/src/components/layout/header.vue @@ -183,7 +183,6 @@ export default { this.$router.replace({ path: '/', query: {} }).catch(err => {}) this.logoutSuccess() window.location.href = '/' - // this.$router.push('/login') }) }, showPinDialog () { diff --git a/nezha-fronted/src/http.js b/nezha-fronted/src/http.js index e8c32eb4f..4d20b545f 100644 --- a/nezha-fronted/src/http.js +++ b/nezha-fronted/src/http.js @@ -103,11 +103,11 @@ axios.interceptors.response.use( return response } if (licenceErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.pathname) == -1) { - sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath + '1') + sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath) window.location.href = '/' } else if (response.status === 200) { if (accountErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.pathname) == -1) { - sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath + '2') + sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath) window.location.href = '/' } } else { diff --git a/nezha-fronted/src/permission.js b/nezha-fronted/src/permission.js index b6c13e019..165a35acd 100644 --- a/nezha-fronted/src/permission.js +++ b/nezha-fronted/src/permission.js @@ -149,7 +149,7 @@ router.beforeEach((to, from, next) => { resolve() } else { localStorage.removeItem('nz-token') - sessionStorage.setItem('nz-previous-page', to.fullPath + '5') + sessionStorage.setItem('nz-previous-page', to.fullPath) next({ path: '/login' }) } }) @@ -180,7 +180,7 @@ router.beforeEach((to, from, next) => { if (loginWhiteList.indexOf(to.path) !== -1) { next() } else { - sessionStorage.setItem('nz-previous-page', to.fullPath + '6') + sessionStorage.setItem('nz-previous-page', to.fullPath) next({ path: '/login' }) } } diff --git a/nezha-fronted/src/store/user.js b/nezha-fronted/src/store/user.js index 5d680d3e8..e08dbca23 100644 --- a/nezha-fronted/src/store/user.js +++ b/nezha-fronted/src/store/user.js @@ -152,12 +152,13 @@ const user = { sessionStorage.removeItem('nz-previous-page') }) } else { - sessionStorage.removeItem('nz-previous-page') router.push({ path: path[0], query: { t: +new Date() } + }).then(() => { + sessionStorage.removeItem('nz-previous-page') }) } })