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

@@ -36,9 +36,9 @@
</template>
<script setup>
import { ref, onMounted } from "vue";
import { ref } from "vue";
import { onShow } from "@dcloudio/uni-app";
import { getLoginUserPhone } from "@/request/api/LoginApi";
import { checkToken } from "@/hooks/useGoLogin";
// 假数据
const userInfo = ref({
@@ -60,11 +60,9 @@ const menuList = ref([
{ label: "订阅消息", type: "action", action: "subscribeMessage" },
]);
// 生命周期钩子
onMounted(() => {
checkToken().then(() => {
getLoginUserPhoneInfo();
});
// 页面生命周期钩子 - 页面显示时调用
onShow(() => {
getLoginUserPhoneInfo();
});
const getLoginUserPhoneInfo = async () => {