兰宝车间质量管理系统-前端
疯狂的狮子Li
2024-11-20 9dd7bf89909a0473ed02a7f1df7442973dd96c1e
fix 修复 手动登出与token过期登出跳转行为不一致问题
已修改1个文件
11 ■■■■ 文件已修改
src/layout/components/Navbar.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Navbar.vue
@@ -98,6 +98,7 @@
import { dynamicClear, dynamicTenant } from '@/api/system/tenant';
import { TenantVO } from '@/api/types';
import notice from './notice/index.vue';
import router from "@/router";
const appStore = useAppStore();
const userStore = useUserStore();
@@ -163,8 +164,14 @@
    cancelButtonText: '取消',
    type: 'warning'
  });
  await userStore.logout();
  location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
  userStore.logout().then(() => {
    router.replace({
      path: '/login',
      query: {
        redirect: encodeURIComponent(router.currentRoute.value.fullPath || '/')
      }
    })
  });
};
const emits = defineEmits(['setLayout']);