feat: 微信小程序登录改造(手机号授权 + API前缀改为/mp-api + 隐私协议检查)

This commit is contained in:
jacobxu666
2026-06-14 21:54:08 +08:00
parent 6ee484d8a3
commit 3af5f2850d
6 changed files with 60 additions and 29 deletions
+3
View File
@@ -11,6 +11,9 @@ export interface WxLoginResult {
accessToken: string
refreshToken: string
userId: number
openId: string
mobile: string
expiresTime: string
}
/** 账号密码登录参数(降级方案) */
+3 -3
View File
@@ -1,9 +1,9 @@
import { get, post } from './request'
import type { UserInfo, WxLoginResult, LoginParams } from './types'
/** 微信授权登录 */
export function wxLogin(code: string): Promise<WxLoginResult> {
return post<WxLoginResult>('/auth/wx-login', { code }, false)
/** 微信小程序登录(loginCode + phoneCode) */
export function wxLogin(data: { loginCode: string; phoneCode: string }): Promise<WxLoginResult> {
return post<WxLoginResult>('/auth/wx-login', data, false)
}
/** 账号密码登录(降级方案) */