云速成

会员接口

个人资料

读取与维护会员资料:昵称、头像、用户名,以及手机号与邮箱的绑定。

获取个人资料

GET/_api/member/profile会员接口

获取当前会员的资料信息。

响应示例

{
  "id": "b1c2d3e4-f5a6-7b8c-9d0e-1f2a3b4c5d6e",
  "username": "zhangsan",
  "nickname": "张三",
  "avatarUrl": null,
  "email": "zhangsan@example.com",
  "phone": "13800000000",
  "usernameChangedAt": null,
  "nextUsernameChangeAt": null,
  "communicationKey": "ck_xxxxxxxx",
  "isDisabled": false,
  "disabledAt": null,
  "createdAt": "2025-10-01T00:00:00Z"
}

更新个人资料

PUT/_api/member/profile会员接口

更新昵称与头像;手机号与邮箱需走绑定接口。

请求体字段

参数类型必填说明
nicknamestring是昵称,1-30 个字符。
avatarUrlstring否头像地址;传 null 或空串表示清空。

请求示例

{ "nickname": "张三", "avatarUrl": "/AppUpload/Image/avatar-01.webp" }

响应示例

{ "id": "b1c2d3e4-f5a6-7b8c-9d0e-1f2a3b4c5d6e", "username": "zhangsan", "nickname": "张三", "avatarUrl": "/AppUpload/Image/avatar-01.webp", "email": "zhangsan@example.com", "phone": "13800000000", "isDisabled": false, "createdAt": "2025-10-01T00:00:00Z" }

修改用户名

PUT/_api/member/username会员接口

修改用户名,每年仅可修改一次;从未修改过的账号可立即修改一次。

请求体字段

参数类型必填说明
usernamestring是新用户名,3-30 个字符,全局唯一。

请求示例

{ "username": "zhangsan_new" }

响应示例

{ "id": "b1c2d3e4-f5a6-7b8c-9d0e-1f2a3b4c5d6e", "username": "zhangsan_new", "nickname": "张三", "usernameChangedAt": "2026-01-05T00:00:00Z", "nextUsernameChangeAt": "2027-01-05T00:00:00Z" }

发送绑定验证码

POST/_api/member/profile/binding/send会员接口

向要绑定的新手机号或邮箱发送验证码。

请求体字段

参数类型必填说明
channelstring是投递渠道:sms(绑定手机号)或 email(绑定邮箱)。
targetstring是要绑定的手机号或邮箱地址。

请求示例

{ "channel": "sms", "target": "13900000000" }

响应示例

{ "expiresIn": 300, "resendAfter": 60 }

确认绑定手机号/邮箱

PUT/_api/member/profile/binding会员接口

校验验证码后写入账号;目标已被其他账号绑定时传 force=true 强制绑定并解除原账号绑定。

请求体字段

参数类型必填说明
channelstring是sms 或 email。
targetstring是要绑定的手机号或邮箱地址。
codestring是6 位验证码。
forceboolean是目标已被其他账号绑定时是否强制绑定。

请求示例

{ "channel": "sms", "target": "13900000000", "code": "123456", "force": false }

响应示例

{ "id": "b1c2d3e4-f5a6-7b8c-9d0e-1f2a3b4c5d6e", "username": "zhangsan", "phone": "13900000000", "email": "zhangsan@example.com" }