Explorar o código

后台退出登录跳转

zhanghao hai 2 meses
pai
achega
390d33f837
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/layout/components/Navbar.vue

+ 3 - 1
src/layout/components/Navbar.vue

@@ -98,7 +98,9 @@ export default {
         type: 'warning'
       }).then(() => {
         this.$store.dispatch('LogOut').then(() => {
-          location.href = '/login';
+          this.$router.push({
+            path: '/login' // 将路径完全替换为 /index
+          });
         })
       }).catch(() => {});
     }