fix: 修复登录拒绝也存token

This commit is contained in:
duanshuwen
2025-09-25 19:11:42 +08:00
parent 86c87b2cc4
commit f3d84c9349
4 changed files with 21 additions and 13 deletions

View File

@@ -10,10 +10,17 @@ export const goBack = () => uni.navigateBack({ delta: 1 });
// 登录逻辑
export const onLogin = async (e) => {
return new Promise(async (resolve) => {
await loginAuth().then(async () => {
console.info("onLogin code: ", e.detail);
return new Promise(async (resolve, reject) => {
// 判断用户拒绝
if (e.detail.errno === 104) {
reject();
return;
}
await loginAuth(e).then(async () => {
const { code } = e.detail;
console.info("onLogin code: ", code);
// 绑定手机号
const params = { wechatPhoneCode: code, clientId: clientId };