feat: 调整登录逻辑

This commit is contained in:
duanshuwen
2025-09-12 22:20:01 +08:00
parent 07752394eb
commit c03a4200be
12 changed files with 248 additions and 175 deletions

View File

@@ -38,6 +38,7 @@
<script setup>
import { ref, onMounted } from "vue";
import { getLoginUserPhone } from "@/request/api/LoginApi";
import { checkToken } from "@/hooks/useGoLogin";
// 假数据
const userInfo = ref({
@@ -60,11 +61,14 @@ const menuList = ref([
// 生命周期钩子
onMounted(() => {
getLoginUserPhoneInfo();
checkToken().then(() => {
getLoginUserPhoneInfo();
});
});
const getLoginUserPhoneInfo = async () => {
const res = await getLoginUserPhone();
if (res.code === 0) {
userInfo.value.phone = res.data;
}