浏览代码

后台退出登录跳转

zhanghao 2 月之前
父节点
当前提交
390d33f837
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/layout/components/Navbar.vue

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

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