feat: 同步管理端、用户端与后端业务,并接通线上 Web 接口

补齐平台订阅、外部登录、CRM 同步与用户端页面;Nginx 转发用户端接口,登录页使用 Google 与 Apple 标志。

Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
wikiboss
2026-09-23 18:01:47 +08:00
父节点 8ea9c25386
当前提交 62e0ae4435
共有 227 个文件被更改,包括 21855 次插入 和 5264 次删除

查看文件

@@ -58,6 +58,69 @@ describe('Point 62 (P1): 展会名片双向互换与 CRM 互加好友验证', ()
const outcome = await service.confirmExchange(invite.id, 402);
expect(outcome.status).toBe('ACCEPTED');
expect(outcome.isDualSynced).toBe(true);
expect(invite.persisted).toBe(false);
expect(outcome.persisted).toBe(false);
});
it('仅内存 Map 保存时,创建与确认结果均应带 persisted:false', async () => {
// 无仓库注入:不得假装已入库
expect((service as any).exchangeEntity).toBeUndefined();
const invite = await service.initiateExchange({
senderCardId: 501,
recipientCardId: 602,
});
expect(invite.persisted).toBe(false);
const outcome = await service.confirmExchange(invite.id, 602);
expect(outcome.status).toBe('ACCEPTED');
expect(outcome.persisted).toBe(false);
});
it('有仓库且写入成功时,创建与确认结果均应带 persisted:true', async () => {
let nextId = 1001;
const store = new Map<number, any>();
(service as any).exchangeEntity = {
save: async (row: any) => {
if (!row.id) {
row.id = nextId++;
}
store.set(Number(row.id), { ...row });
return row;
},
findOne: async ({ where }: { where: { id?: number } }) => {
if (where?.id == null) return null;
const hit = store.get(Number(where.id));
return hit ? { ...hit } : null;
},
};
const invite = await service.initiateExchange({
senderCardId: 701,
recipientCardId: 802,
});
expect(invite.persisted).toBe(true);
expect(invite.id).toBe('1001');
const outcome = await service.confirmExchange(invite.id, 802);
expect(outcome.status).toBe('ACCEPTED');
expect(outcome.persisted).toBe(true);
});
it('找不到邀约时应报错,不得伪造成功互换', async () => {
await expect(
service.confirmExchange('xchg_missing_nowhere', 402)
).rejects.toThrow(/未找到该名片互换邀约/);
});
it('有仓库但库中与内存均无此邀约时,确认应失败而非造一条成功互换', async () => {
(service as any).exchangeEntity = {
findOne: async () => null,
save: async (row: any) => row,
};
await expect(service.confirmExchange('99999', 402)).rejects.toThrow(
/未找到该名片互换邀约/
);
});
});
});