feat(users): 拆分 C 端身份并迁移历史聊天

- digital.users: 独立开户登录与凭据版本校验,后台查看用户及原始会话
- 017迁移: 保留聊天消息、实验分组和人工指定期限,迁移历史账号归属
- tests: 覆盖身份隔离、凭据失效、会话归属和长账号登录,同步 README
This commit is contained in:
湛兮
2026-10-27 18:56:19 +08:00
parent 57c89f4f32
commit b9d1a7f6bd
14 changed files with 747 additions and 32 deletions
+8 -3
View File
@@ -38,7 +38,7 @@ async function exercise(
[
{
id: "continue-unit",
account: "employee:1",
account: "user:1",
character_id: "card",
settings: {},
},
@@ -105,7 +105,8 @@ async function exercise(
release: () => {},
}));
t.mock.method(authService, "getCurrentUser", async () => ({
accountType: "EMPLOYEE",
accountType: "DIGITAL_USER",
scene: "DIGITAL_APP",
}));
t.mock.method(
globalThis,
@@ -122,7 +123,11 @@ async function exercise(
const app = createApp();
try {
await app.ready();
const token = app.jwt.sign({ sub: "employee:1", accountType: "EMPLOYEE" });
const token = app.jwt.sign({
sub: "user:1",
accountType: "DIGITAL_USER",
scene: "DIGITAL_APP",
});
const response = await app.inject({
method: "POST",
url: "/api/digital/conversations/continue-unit/stream",