diff --git a/src/store/modules/user.js b/src/store/modules/user.js index f26c355..4a518d1 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -92,7 +92,9 @@ const user = { logout().then(res => { commit('SET_TOKEN', '') removeToken() + location.reload() resolve() + }) }) diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue index cfec7ad..094b8a4 100644 --- a/src/views/layout/components/Navbar.vue +++ b/src/views/layout/components/Navbar.vue @@ -54,9 +54,7 @@ Screenfull, this.$store.dispatch('ToggleSideBar') }, logout() { - this.$store.dispatch('FedLogOut').then(() => { - location.reload() // 为了重新实例化vue-router对象 避免bug - }) + this.$store.dispatch('FedLogOut') }, changepassword() { @@ -98,7 +96,7 @@ Screenfull, } .screenfull { position: absolute; - right: 90px; + right: 120px; top: 14px; color: red;