feat: 同步管理端、用户端与后端业务,并接通线上 Web 接口
补齐平台订阅、外部登录、CRM 同步与用户端页面;Nginx 转发用户端接口,登录页使用 Google 与 Apple 标志。 Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
@@ -343,6 +343,41 @@ describe('Task 08: 后端公开短链路由与秒级微官网详情 API (Card Po
|
||||
const res = await portalController.detail(undefined, undefined, undefined);
|
||||
expect(res.code).not.toBe(1000);
|
||||
});
|
||||
|
||||
describe('GET /open/card/portal/mock-cards (ALLOW_PORTAL_MOCK)', () => {
|
||||
const prevAllow = process.env.ALLOW_PORTAL_MOCK;
|
||||
|
||||
afterEach(() => {
|
||||
if (prevAllow === undefined) {
|
||||
delete process.env.ALLOW_PORTAL_MOCK;
|
||||
} else {
|
||||
process.env.ALLOW_PORTAL_MOCK = prevAllow;
|
||||
}
|
||||
});
|
||||
|
||||
it('默认(未开启 ALLOW_PORTAL_MOCK)应返回空数组,不含演示姓名', async () => {
|
||||
delete process.env.ALLOW_PORTAL_MOCK;
|
||||
const res = await portalController.mockCards();
|
||||
expect(res.code).toBe(1000);
|
||||
expect(Array.isArray((res as any).data)).toBe(true);
|
||||
expect((res as any).data).toEqual([]);
|
||||
const payload = JSON.stringify((res as any).data);
|
||||
expect(payload).not.toContain('Alex Zheng');
|
||||
expect(payload).not.toContain('Marcus Weber');
|
||||
});
|
||||
|
||||
it('ALLOW_PORTAL_MOCK=1 时才返回原演示名片清单', async () => {
|
||||
process.env.ALLOW_PORTAL_MOCK = '1';
|
||||
const res = await portalController.mockCards();
|
||||
expect(res.code).toBe(1000);
|
||||
const list = (res as any).data;
|
||||
expect(Array.isArray(list)).toBe(true);
|
||||
expect(list.length).toBeGreaterThanOrEqual(6);
|
||||
expect(list[0].slug).toBe('alex-zheng');
|
||||
expect(list[0].name).toBe('Alex Zheng');
|
||||
expect(list[0].bentoBlocksCount).toBeGreaterThanOrEqual(5);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('6. suggestedLocale 浅拷贝且不污染缓存 (T18)', () => {
|
||||
|
||||
在新工单中引用
屏蔽一个用户