From 5980d4a7161db132775b7cd12f7ad5c72bb49318 Mon Sep 17 00:00:00 2001
From: “mitao” <“2763622819@qq.com”>
Date: 星期四, 07 五月 2026 17:08:13 +0800
Subject: [PATCH] fix:微信登录未绑定手机号也能成功问题
---
traditionalApp/pages/bindPhone/bindPhone.vue | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/traditionalApp/pages/bindPhone/bindPhone.vue b/traditionalApp/pages/bindPhone/bindPhone.vue
index 8beabff..42babcb 100644
--- a/traditionalApp/pages/bindPhone/bindPhone.vue
+++ b/traditionalApp/pages/bindPhone/bindPhone.vue
@@ -45,8 +45,9 @@
<script setup lang="ts">
import { ref } from 'vue'
import { bindSettingsPhone, sendBindPhoneCode } from './service.js'
-import { saveAuthSession } from '@/utils/auth-session.js'
+import { clearAuthSession, saveAuthSession } from '@/utils/auth-session.js'
import { clearCachedInviteCode, getCachedInviteCode } from '@/utils/invite-cache.js'
+import { clearJPushAliasBinding } from '@/utils/push.js'
interface ApiResponse<T> {
code: number
@@ -89,6 +90,7 @@
isFocused.value = false
return
}
+ clearPendingLoginSession()
uni.redirectTo({
url: '/pages/login/login'
})
@@ -246,6 +248,14 @@
}
/**
+ * 放弃绑定手机号时清理第三方临时登录态,避免返回后被识别为已登录。
+ */
+const clearPendingLoginSession = () => {
+ clearAuthSession()
+ clearJPushAliasBinding()
+}
+
+/**
* 判断接口响应是否为成功态。
*/
const isSuccessResponse = (response: ApiResponse<unknown> | undefined) => {
--
Gitblit v1.7.1