fix(login): 恢复手机号快捷登录功能,避免带旧Token导致失败

- 将 login.tsx 和 register.tsx 中登录请求从封装的 request 工具改回 Taro.request
- 取消登录请求中自动注入 Authorization 头,避免携带过期/旧 token 导致认证失败
- 调整登录接口响应数据解析,适配 Taro.request 的数据结构
- fetchUserInfo 改回使用 Taro.request,手动携带 Authorization 头部
- 添加全局 getPhoneNumber 调用冷却机制,防止频繁调用导致微信报错
- 登录页新增手机授权冷却
This commit is contained in:
2026-07-16 17:01:17 +08:00
parent ce1e2bd4dd
commit 46298c011f
9 changed files with 322 additions and 45 deletions

View File

@@ -4,7 +4,7 @@
* 必须在页面中渲染 <PrivacyModal /> 并绑定本管理器。
*/
type PrivacyResolve = (result: { event: 'agree' | 'disagree'; button: string }) => void
type PrivacyResolve = (result: { event: 'agree' | 'disagree'; buttonId: string }) => void
let currentResolve: PrivacyResolve | null = null
let showCallback: ((show: boolean) => void) | null = null
@@ -31,16 +31,22 @@ export const privacyManager = {
showCallback?.(true)
},
/** 隐私协议授权流程已结束,隐藏弹窗 */
hide() {
currentResolve = null
showCallback?.(false)
},
/** 用户点击同意(由 open-type=agreePrivacyAuthorization 的 button 触发) */
agree() {
currentResolve?.({ event: 'agree', button: 'agree' })
currentResolve?.({ event: 'agree', buttonId: 'privacy-agree-btn' })
currentResolve = null
showCallback?.(false)
},
/** 用户点击拒绝 */
disagree() {
currentResolve?.({ event: 'disagree', button: 'disagree' })
currentResolve?.({ event: 'disagree', buttonId: 'privacy-disagree-btn' })
currentResolve = null
showCallback?.(false)
},