From f700b0341e12143b43b128406058028994cf811d Mon Sep 17 00:00:00 2001 From: Leonel Matos Date: Sun, 16 Feb 2020 00:04:43 -0400 Subject: [PATCH] bugfix login from redirect (#333) --- src/layout/components/Navbar.vue | 2 +- src/store/modules/user.js | 2 +- src/views/login/index.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 }