POST /auth/login/phone-code
使用手机验证码进行免密登录,支持自动注册
身份认证 None application/json
请求体
Schema: service-identity/internal/handler/dto.LoginByPhoneCodeRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
code |
string |
是 |
|
|
|
phone |
string |
是 |
|
|
|
captcha_challenge_id |
string |
否 |
|
|
|
captcha_token |
string |
否 |
|
|
|
password |
string |
否 |
|
|
|
password_transmission |
string |
否 |
|
|
|
register_if_new |
boolean |
否 |
|
|
|
tenant_id |
string |
否 |
|
|
|
username |
string |
否 |
|
|
仅 register_if_new 且用户不存在时使用;不参与已存在用户的 code 登录。 |
引用的 Schema
service-identity/internal/handler/dto.LoginByCodeResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
access_token |
string |
否 |
|
|
|
expires_in |
integer |
否 |
|
|
|
is_new_user |
boolean |
否 |
|
|
|
membership_status |
string |
否 |
pending |
|
MembershipStatus 新注册待审批(WS-A A3);pending 时不返回 token。 |
refresh_token |
string |
否 |
|
|
|
token_type |
string |
否 |
|
|
|
user |
service-identity/internal/handler/dto.UserInfo |
否 |
|
|
|
user_id |
string |
否 |
|
|
User ID (redundant with User.ID for flat access) |
service-identity/internal/handler/dto.UserInfo
用户基本信息
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
created_at |
string |
否 |
2026-01-15T10:30:00Z |
|
Account creation time |
email |
string |
否 |
john@example.com |
|
Email |
id |
string |
否 |
usr_abc123 |
|
User ID |
last_login_at |
string |
否 |
2026-07-20T08:00:00Z |
|
Last login time |
metadata |
object |
否 |
|
|
AUTH-44:metadata 仅 /auth/me 回传(portal 偏好等);其余构造点省略。 |
mfa_enabled |
boolean |
否 |
True |
|
AUTH-44:指针 + omitempty —— 仅权威构造点(/auth/me)填充;其余构造点省略该键,
避免登录响应等处误报 mfa_enabled=false(零值不等于"未启用")。 |
must_change_password |
boolean |
否 |
False |
|
Password must be changed |
password_expires_in |
integer |
否 |
30 |
|
Days until password expires |
password_warning |
string |
否 |
expiring |
|
Password warning: expiring/expired_grace/expired |
phone |
string |
否 |
13800138000 |
|
Phone |
status |
string |
否 |
active |
|
Status |
username |
string |
否 |
john.doe |
|
Username |