feat(users): 新增独立用户与聊天记录管理

- users.vue: 支持开户、停用、重置密码和按会话查看原始消息
- digital 路由与接口: 区分用户管理和实验用户分组,同步教程与文档
This commit is contained in:
湛兮
2026-10-27 18:56:11 +08:00
parent 4c35e50270
commit 0b7c1cba24
9 changed files with 665 additions and 11 deletions
+34 -1
View File
@@ -1091,7 +1091,7 @@ export type Result<T> = { success: boolean; data: T };
/** 数字人后台 API,复用已有 JWT 拦截器。 */
export async function digital<T>(
path: string,
method: "get" | "post" | "put" | "delete" = "get",
method: "get" | "post" | "put" | "patch" | "delete" = "get",
data?: unknown
): Promise<T> {
try {
@@ -1224,3 +1224,36 @@ export type ExperimentUser = {
};
assignment: null | { variant: string; createdAt: string };
};
/** 独立 C 端用户的后台公开资料,不含密码/令牌或员工权限。 */
export type DigitalUser = {
id: number;
account: string;
username: string;
displayName: string;
status: "ACTIVE" | "INACTIVE";
createdAt: string;
lastLoginAt: string | null;
conversations: number;
messages: number;
};
/** 用户所属会话的只读摘要。 */
export type UserConversation = {
id: string;
title: string;
characterId: string;
characterName: string;
messages: number;
createdAt: string;
updatedAt: string;
};
/** 持久化聊天消息;包括已停止、失败和被替换的历史版本。 */
export type UserChatMessage = {
id: string;
role: "user" | "assistant";
content: string;
status: string;
pinned: number;
sequenceId: number;
createdAt: string;
};