PATCH/api/v1/me更新我的资料
Try it 面板需要启用 JavaScript。
更新昵称、头像等展示字段;未提供的字段保持不变。
Request
| Name | Data Type | Required | Description |
| Authorization | string | Yes | 会话令牌认证,格式 `Bearer <sessionToken>` |
| Content-Type | string | Yes | 请求体内容类型(默认值 "application/json") |
type RequestHeaders = {
/** 会话令牌认证,格式 `Bearer <sessionToken>` */
Authorization: string
/** 请求体内容类型,默认值 "application/json" */
Content-Type: string
}
{
"Authorization": "Bearer st_7c1f9e05b28d4a63",
"Content-Type": "application/json"
}
Body
| Name | Data Type | Required | Description |
| displayName | string | No | 昵称 |
| avatarUrl | string | No | 头像地址 |
type RequestBody = {
/** 昵称 */
displayName?: string
/** 头像地址 */
avatarUrl?: string
}
{
"displayName": "林林",
"avatarUrl": "https://cdn.xeegam.com/passport/avatars/01JD8SEGQ0P9N2XK4L7VDH3T6C-v2.png"
}
Response
Body
| Name | Data Type | Required | Description |
| userId | string | Yes | 用户 ID |
| username | string | Yes | 用户名 |
| displayName | string | Yes | 昵称 |
| avatarUrl | string | No | 头像地址 |
| status | string | Yes | 账号状态:active / frozen |
| createdAt | string | Yes | 注册时间(ISO 8601 UTC) |
type UserProfileDTO = {
/** 用户 ID */
userId: string
/** 用户名 */
username: string
/** 昵称 */
displayName: string
/** 头像地址 */
avatarUrl?: string
/** 账号状态:active / frozen */
status: string
/** 注册时间(ISO 8601 UTC) */
createdAt: string
}
{
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"username": "chenlin",
"displayName": "陈林",
"avatarUrl": "https://cdn.xeegam.com/passport/avatars/01JD8SEGQ0P9N2XK4L7VDH3T6C.png",
"status": "active",
"createdAt": "2026-10-14T08:05:00Z"
}
HTTP Code
| HTTP Status |
Meaning |
Notes |
| 200 |
成功 |
返回更新后的资料 |
Response Code
响应使用统一信封 {id, code, messages, result},其 code 字段:
| code |
Meaning |
Notes |
| 0 |
成功 |
返回更新后的资料 |
Examples
PATCH /api/v1/me
Authorization: Bearer st_7c1f9e05b28d4a63
Content-Type: application/json
{
"displayName": "林林",
"avatarUrl": "https://cdn.xeegam.com/passport/avatars/01JD8SEGQ0P9N2XK4L7VDH3T6C-v2.png"
}
{
"id": "01JD8SNUBO3V6W2CW",
"code": 0,
"messages": [],
"result": {
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"username": "chenlin",
"displayName": "林林",
"avatarUrl": "https://cdn.xeegam.com/passport/avatars/01JD8SEGQ0P9N2XK4L7VDH3T6C-v2.png",
"status": "active",
"createdAt": "2026-10-14T08:05:00Z"
}
}