Browse Source

再次尝试

1
mo 2 years ago
parent
commit
3875278c62
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/views/layout/components/Navbar.vue

+ 5 - 2
src/views/layout/components/Navbar.vue

@@ -52,8 +52,11 @@ export default {
     },
     },
     logout() {
     logout() {
       this.$store.dispatch('LogOut').then(() => {
       this.$store.dispatch('LogOut').then(() => {
-        this.$router.push('/login')
-        location.reload(true) // 为了重新实例化vue-router对象 避免bug
+        setTimeout(()=>{
+          this.$router.push('/login')
+        // location.reload(true) // 为了重新实例化vue-router对象 避免bug
+        },500)
+
         // console.log(location.hostname+'/mall')
         // console.log(location.hostname+'/mall')
         // location.href = location.hostname+'/mall'
         // location.href = location.hostname+'/mall'
       })
       })