feat: 登录逻辑的调整

This commit is contained in:
2025-09-20 16:13:07 +08:00
parent 67474d73a4
commit 4cdff7a594
6 changed files with 25 additions and 61 deletions

View File

@@ -13,18 +13,12 @@
<script setup>
import { ref } from "vue";
import DrawerHome from "@/pages/drawer/DrawerHome.vue";
import { goLogin } from "@/hooks/useGoLogin";
import { useAppStore } from "@/store";
const appStore = useAppStore();
import { checkToken } from "@/hooks/useGoLogin";
const showLeft = ref(false);
// 打开窗口
const showDrawer = (e) => {
if (!appStore.hasToken) {
console.log("没有token跳转到登录页");
goLogin();
return;
}
const showDrawer = async (e) => {
await checkToken();
showLeft.value.open();
// 发送抽屉显示事件