Skip to content

用户接口

用户信息相关的 API 接口。

获取当前用户

获取当前登录用户的详细信息。

请求

http
GET /api/users/me
Authorization: Bearer <token>

响应

成功 (200):

json
{
  "userId": 123,
  "phone": "13800138000",
  "email": "user@example.com",
  "createdAt": "2026-01-29T10:30:00Z",
  "updatedAt": "2026-01-30T15:45:00Z"
}

响应字段

字段类型说明
userIdnumber用户 ID
phonestring手机号 (可能为 null)
emailstring邮箱 (可能为 null)
createdAtstring创建时间 (ISO 8601)
updatedAtstring更新时间 (可能为 null)

错误响应

未授权 (401):

json
{
  "code": 401,
  "message": "Token 无效或已过期"
}

Mooting 开发者文档