feat: 调整登录逻辑
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user