用户详情

This commit is contained in:
ryan
2026-06-09 15:30:12 +08:00
parent 92664273ed
commit 73b220de3c
11 changed files with 1005 additions and 20 deletions
@@ -289,6 +289,15 @@ export class AdminService extends BaseService {
return this.get<ListUsersResponse>('/users', request as unknown as Record<string, unknown>);
}
/**
* 获取用户详情
* @param id - 用户 ID
* @returns 用户完整资料
*/
static async getUser(id: string): Promise<AdminUser> {
return this.get<AdminUser>(`/users/${ id }`);
}
/**
* 更新用户状态
* @param id - 用户 ID
@@ -326,6 +335,14 @@ export class AdminService extends BaseService {
return this.post<AdminUser>('/users', request);
}
/**
* 删除用户
* @param id - 用户 ID
*/
static async deleteUser(id: string): Promise<void> {
return this.delete<void>(`/users/${ id }`);
}
/**
* 获取系统状态
* @returns 系统状态指标数据
+12 -1
View File
@@ -194,12 +194,24 @@ export interface AdminUser {
username: string;
/** 昵称 */
nickname: string;
/** 邮箱 */
email?: string;
/** 头像 URL */
avatar_url: string;
/** 是否激活 */
is_active: boolean;
/** 是否管理员 */
is_admin: boolean;
/** 个人简介 */
bio?: string;
/** 手机号 */
phone?: string;
/** 性别 */
gender?: string;
/** 个人网站 */
website?: string;
/** 所在地 */
location?: string;
/** 最后登录时间 */
last_login_at: string;
/** 创建时间 */
@@ -363,4 +375,3 @@ export interface UpdateTemplateRequest {
content: string;
description: string;
}