feat: 优化登录逻辑

This commit is contained in:
2026-01-06 19:42:10 +08:00
parent 7e02429f6e
commit 9c658e9f9f
6 changed files with 30 additions and 30 deletions

View File

@@ -52,7 +52,6 @@ import CheckBox from "@/components/CheckBox/index.vue";
import AgreePopup from "./components/AgreePopup/index.vue";
import { zniconsMap } from "@/static/fonts/znicons";
import { getCurrentConfig } from "@/constant/base";
import { NOTICE_EVENT_LOGIN_SUCCESS } from "@/constant/constant";
// 是否需要微信手机号授权登录
const needWxAuthLogin = ref(false);
@@ -79,7 +78,7 @@ const handleAgreeAndGetPhone = () => {
return;
}
refreshToken(true).then(() => loginSuccess());
refreshToken().then(() => loginSuccess());
};
/// 获取授权后绑定手机号登录
@@ -92,13 +91,16 @@ const getPhoneNumber = (e) => {
return;
}
onLogin(e).then(() => loginSuccess())
.catch(() => { });
.catch(() => {
uni.showToast({
title: "获取登录手机号失败",
icon: "none",
});
});
};
/// 登录成功返回上一页
const loginSuccess = () => {
// 登录成功后,触发登录成功事件
uni.$emit(NOTICE_EVENT_LOGIN_SUCCESS);
uni.showToast({
title: "登录成功",
icon: "success",