NATSprofile.user.update更新用户展示资料
Try it 面板需要启用 JavaScript。
更新昵称、头像等展示字段;未提供的字段保持不变。
Request Payload
消息格式:JSON
| Name | Data Type | Required | Description |
|---|---|---|---|
| userId | string | Yes | 用户 ID |
| displayName | string | No | 昵称 |
| avatarUrl | string | No | 头像地址 |
type RequestBody = {
/** 用户 ID */
userId: string
/** 昵称 */
displayName?: string
/** 头像地址 */
avatarUrl?: string
}{
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"displayName": "林林"
}Response Payload
回复使用统一信封 {id, code, messages, result},其 result:
| Name | Data Type | Required | Description |
|---|---|---|---|
| userId | string | Yes | 用户 ID |
| username | string | No | 用户名 |
| displayName | string | Yes | 昵称 |
| avatarUrl | string | No | 头像地址 |
| createdAt | string | No | 注册时间 |
type ResponseBody = {
/** 用户 ID */
userId: string
/** 用户名 */
username?: string
/** 昵称 */
displayName: string
/** 头像地址 */
avatarUrl?: string
/** 注册时间 */
createdAt?: string
}{
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"username": "chenlin",
"displayName": "林林",
"avatarUrl": "https://cdn.xeegam.com/passport/avatars/01JD8SEGQ0P9N2XK4L7VDH3T6C.png",
"createdAt": "2026-10-14T08:05:00Z"
}Response Code
回复使用统一信封 {id, code, messages, result},其 code 字段:
| code | Meaning | Notes |
|---|---|---|
| 0 | 成功 | 更新用户展示资料 |
Examples
{
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"displayName": "林林"
}
{
"id": "01JD8SV37N9I5K2LH",
"code": 0,
"messages": [],
"result": {
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"username": "chenlin",
"displayName": "林林",
"avatarUrl": "https://cdn.xeegam.com/passport/avatars/01JD8SEGQ0P9N2XK4L7VDH3T6C.png",
"createdAt": "2026-10-14T08:05:00Z"
}
}