feat(digital): 打造星港响应式数字人对话空间

新增角色探索、收藏、世界书和身份资料;接入流式打字、停止重生成、固定记忆、会话分支与导出;适配手机和桌面并保持实验只由后台控制。
This commit is contained in:
湛兮
2026-10-27 10:25:40 +08:00
parent 6b0dd6ea67
commit b7433acba4
37 changed files with 3914 additions and 106 deletions
+6 -5
View File
@@ -1,3 +1,4 @@
/** 数字人登录 BFF,令牌仅写入 HttpOnly Cookie,不返回浏览器。 */
import { setSessionToken } from "@/lib/session";
import { BackendError, backendRequest } from "@/lib/backend";
import type { LoginResponse } from "@/lib/types";
@@ -5,13 +6,13 @@ import type { LoginResponse } from "@/lib/types";
export async function POST(request: Request) {
try {
const body = await request.json();
const result = await backendRequest<LoginResponse>("/auth/employee/login", {
const result = await backendRequest<LoginResponse>("/auth/digital/login", {
method: "POST",
body: JSON.stringify({
username: body.username,
password: body.password
password: body.password,
}),
token: ""
token: "",
});
await setSessionToken(result.token);
@@ -21,8 +22,8 @@ export async function POST(request: Request) {
data: {
user: result.user,
tokenType: result.tokenType,
expiresIn: result.expiresIn
}
expiresIn: result.expiresIn,
},
});
} catch (error) {
const status = error instanceof BackendError ? error.status : 500;