feat: 同步管理端、用户端与后端业务,并接通线上 Web 接口
补齐平台订阅、外部登录、CRM 同步与用户端页面;Nginx 转发用户端接口,登录页使用 Google 与 Apple 标志。 Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
@@ -56,6 +56,25 @@ describe('AdminDeepSeekController 多租户 BYOK 与 Token 用量控制台 (TDD)
|
||||
expect(service.isConfigured()).toBe(true);
|
||||
expect(service.getConfig().apiKey).toBe('sk-platform-master-key-999999');
|
||||
});
|
||||
|
||||
it('租户 BYOK 经 setTenantConfig 写穿,无 repository 时内存 Map 兜底仍可被管理端读取', async () => {
|
||||
await service.setTenantConfig(555, {
|
||||
apiKey: 'sk-tenant-555-byok-key-abcdef',
|
||||
model: 'deepseek-reasoner',
|
||||
});
|
||||
|
||||
(controller as any).ctx = {
|
||||
admin: { username: 'tenant_admin_555', tenantId: 555 },
|
||||
};
|
||||
|
||||
const res: any = await controller.config({});
|
||||
expect(res.code).toBe(1000);
|
||||
expect(res.data.isConfigured).toBe(true);
|
||||
expect(res.data.model).toBe('deepseek-reasoner');
|
||||
expect(res.data.apiKey).toBe('sk-t****cdef');
|
||||
// 脱敏回显不得包含完整密钥
|
||||
expect(JSON.stringify(res)).not.toContain('sk-tenant-555-byok-key-abcdef');
|
||||
});
|
||||
});
|
||||
|
||||
describe('2. 租户 Token 消耗统计与用量查询 (POST /usage)', () => {
|
||||
|
||||
在新工单中引用
屏蔽一个用户