用户接口
用户信息相关的 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"
}响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
| userId | number | 用户 ID |
| phone | string | 手机号 (可能为 null) |
| string | 邮箱 (可能为 null) | |
| createdAt | string | 创建时间 (ISO 8601) |
| updatedAt | string | 更新时间 (可能为 null) |
错误响应
未授权 (401):
json
{
"code": 401,
"message": "Token 无效或已过期"
}