Skip to content

用户模块接口

1. 获取用户信息

  • URL: /api/users/:id
  • Method: GET
  • Auth: Required

请求参数

参数名类型必填描述
idstring用户ID

响应示例

json
{
  "code": 200,
  "data": {
    "id": "12345",
    "username": "johndoe",
    "email": "john@example.com"
  },
  "message": "success"
}

2. 更新用户资料

  • URL: /api/users/:id
  • Method: PUT
  • Auth: Required

请求体

json
{
  "nickname": "John D.",
  "avatar": "https://example.com/avatar.jpg"
}

Released under the MIT License.