GET/api/v1/admin/users/:userId查看用户详情
Try it 面板需要启用 JavaScript。
返回管理视角的用户详情:基础资料、联系方式、三方绑定、会话与角色概况。
Request
| Name | Data Type | Required | Description |
| Authorization | string | Yes | 会话令牌认证,格式 `Bearer <sessionToken>` |
type RequestHeaders = {
/** 会话令牌认证,格式 `Bearer <sessionToken>` */
Authorization: string
}
URL Parameters
| Name |
Data Type |
Description |
| userId |
string |
用户 ID |
Response
Body
| Name | Data Type | Required | Description |
| userId | string | Yes | 用户 ID |
| username | string | Yes | 用户名 |
| displayName | string | Yes | 昵称 |
| status | string | Yes | active / frozen |
| contacts | array | Yes | 联系方式 |
| linkedProviders | array | Yes | 三方提供方列表 |
| sessionCount | number | Yes | 活跃会话数 |
| hasPassword | boolean | Yes | 是否设置密码 |
| mfaEnabled | boolean | Yes | 是否启用 MFA |
| createdAt | string | Yes | 注册时间 |
| lastLoginAt | string | No | 最近登录时间 |
type ResponseBody = {
/** 用户 ID */
userId: string
/** 用户名 */
username: string
/** 昵称 */
displayName: string
/** active / frozen */
status: string
/** 联系方式 */
contacts: Record<string, unknown>[]
/** 三方提供方列表 */
linkedProviders: string[]
/** 活跃会话数 */
sessionCount: number
/** 是否设置密码 */
hasPassword: boolean
/** 是否启用 MFA */
mfaEnabled: boolean
/** 注册时间 */
createdAt: string
/** 最近登录时间 */
lastLoginAt?: string
}
{
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"username": "chenlin",
"displayName": "陈林",
"status": "active",
"contacts": [
{
"channel": "phone",
"target": "+8613800001234"
},
{
"channel": "email",
"target": "chen.lin@example.com"
}
],
"linkedProviders": [
"github"
],
"sessionCount": 2,
"hasPassword": true,
"mfaEnabled": true,
"createdAt": "2026-10-14T08:05:00Z",
"lastLoginAt": "2026-10-14T08:00:00Z"
}
HTTP Code
| HTTP Status |
Meaning |
Notes |
| 200 |
成功 |
返回用户详情 |
Response Code
响应使用统一信封 {id, code, messages, result},其 code 字段:
| code |
Meaning |
Notes |
| 0 |
成功 |
返回用户详情 |
Examples
GET /api/v1/admin/users/01JD8SEGQ0P9N2XK4L7VDH3T6C
Authorization: Bearer st_7c1f9e05b28d4a63
{
"id": "01JD8SSZPU4P7RG",
"code": 0,
"messages": [],
"result": {
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"username": "chenlin",
"displayName": "陈林",
"status": "active",
"contacts": [
{ "channel": "phone", "target": "+8613800001234" },
{ "channel": "email", "target": "chen.lin@example.com" }
],
"linkedProviders": ["github"],
"sessionCount": 2,
"hasPassword": true,
"mfaEnabled": true,
"createdAt": "2026-10-14T08:05:00Z",
"lastLoginAt": "2026-10-14T08:00:00Z"
}
}