feat(auth): 小程序登录支持配置化与手机号一键登录自动注册 / Add configurable xcx login with phone auto-registration

- 小程序 appid/密钥支持参数管理 sys.account.xcxApps(JSON 数组,多小程序)优先,yml security.xcx.apps 兜底
- 登录新增 phoneCode 字段,调用微信 getuserphonenumber 解析真实手机号,stable_token 按小程序缓存至 redis
- 首次登录自动注册:以授权手机号为账号(已有同手机号账号则直接绑定),写入 sys_social 绑定 openid
- 自动注册默认昵称/初始密码(sys.user.initPassword)/头像/性别,用户类型 app_user
This commit is contained in:
2026-08-30 18:07:34 +08:00
parent 4f63d9ab7b
commit 42052f7bf5
6 changed files with 238 additions and 11 deletions
+5
View File
@@ -10,6 +10,11 @@ security:
numberLength: 1
# 字符验证码长度
charLength: 4
# 小程序登录配置(grantType=xcx)
# 优先使用参数管理中的 sys.account.xcxApps(JSON 数组,支持多个小程序);未配置该参数时回退使用此处的 yml 映射
xcx:
apps:
# 你的小程序appid: 你的小程序appSecret
# 用户配置
user: