diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 40c503da..c2f771a2 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -123,7 +123,7 @@ export default { }, async logout() { await this.$store.dispatch('user/logout') - this.$router.push(`/login?redirect=${this.$route.fullPath}`) + this.$router.push({ path: '/login', query: { redirect: this.$route.fullPath }}) }, handleClick() { this.$router.push({ name: 'Profile' }) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index e305ada5..8b276787 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -169,7 +169,7 @@ const actions = { root: true }) - // dispatch('tagsView/delAllViews', null, { root:true }) + dispatch('tagsView/delAllViews', null, { root: true }) removeToken() removeCurrentRole() resetRouter() diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 84821526..a1cbbcbc 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -134,7 +134,7 @@ export default { watch: { $route: { handler: function(route) { - this.redirect = route.query && route.query.redirect + this.redirect = route.query.redirect }, immediate: true }