feat: 调整优化登录的逻辑

This commit is contained in:
2025-09-15 22:52:44 +08:00
parent 66c256cefd
commit fc63bbc994
15 changed files with 190 additions and 159 deletions

View File

@@ -11,18 +11,30 @@
</template>
<script setup>
import { defineEmits, ref } from "vue";
import { ref } from "vue";
import DrawerHome from "@/pages/drawer/DrawerHome.vue";
import { goLogin } from "@/hooks/useGoLogin";
import { useAppStore } from "@/store";
const appStore = useAppStore();
const showLeft = ref(false);
// 打开窗口
const showDrawer = (e) => {
if (!appStore.hasToken) {
console.log("没有token跳转到登录页");
goLogin();
return;
}
showLeft.value.open();
// 发送抽屉显示事件
uni.$emit("drawerShow");
};
// 关闭窗口
const closeDrawer = (e) => {
showLeft.value.close();
// 发送抽屉隐藏事件
uni.$emit("drawerHide");
};
</script>