feat: 同步管理端、用户端与后端业务,并接通线上 Web 接口
补齐平台订阅、外部登录、CRM 同步与用户端页面;Nginx 转发用户端接口,登录页使用 Google 与 Apple 标志。 Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
@@ -67,6 +67,7 @@ export interface UseSecurityModule {
|
||||
id: number,
|
||||
api?: SecurityApi
|
||||
) => Promise<NfcSecurityDevice>;
|
||||
resolveSecurityText: (key: string, locale?: string) => string;
|
||||
}
|
||||
|
||||
function loadUseSecurity(): UseSecurityModule {
|
||||
@@ -279,6 +280,8 @@ describe('Point 13: 移动端 NFC 安全与远程挂失测试套件', () => {
|
||||
// 设计 Token 引用检查
|
||||
expect(content).toContain('--oc-primary');
|
||||
expect(content).toContain('--oc-border');
|
||||
expect(content).toContain('--oc-error');
|
||||
expect(content).toContain('--oc-surface');
|
||||
});
|
||||
|
||||
it('4.2 pages.json 中已正确注册 pages/owner/nfc/security 页面', () => {
|
||||
@@ -292,5 +295,36 @@ describe('Point 13: 移动端 NFC 安全与远程挂失测试套件', () => {
|
||||
);
|
||||
expect(registered).toBe(true);
|
||||
});
|
||||
|
||||
it('4.3 挂失主按钮用 error token,禁止 #D92D20 与纯白硬编码底', () => {
|
||||
const content = fs.readFileSync(SECURITY_PAGE, 'utf-8');
|
||||
|
||||
// 禁止旧危险色硬编码
|
||||
expect(content).not.toContain('#D92D20');
|
||||
expect(content).not.toMatch(/#d92d20/i);
|
||||
|
||||
// 挂失 danger CTA 必须引用 CSS 变量 --oc-error
|
||||
expect(content).toMatch(/\.cta-btn-danger\s*\{[^}]*--oc-error/s);
|
||||
|
||||
// pageTheme 注入 error token
|
||||
expect(content).toContain("'--oc-error': utsLightColors.error");
|
||||
|
||||
// 禁止裸写纯白底(允许 var(--oc-surface, #FFFFFF) 回退)
|
||||
expect(content).not.toMatch(/background-color:\s*#FFFFFF\b/i);
|
||||
expect(content).not.toMatch(/background:\s*#FFFFFF\b/i);
|
||||
});
|
||||
|
||||
it('4.4 「处理中」禁止写死在页面,须走 resolveSecurityText 且中英齐全', () => {
|
||||
const pageContent = fs.readFileSync(SECURITY_PAGE, 'utf-8');
|
||||
const utsContent = fs.readFileSync(SECURITY_UTS, 'utf-8');
|
||||
|
||||
expect(pageContent).not.toContain('处理中');
|
||||
expect(pageContent).toContain("t('submitting')");
|
||||
expect(utsContent).toContain("case 'submitting'");
|
||||
|
||||
const { resolveSecurityText } = loadUseSecurity();
|
||||
expect(resolveSecurityText('submitting', 'zh-CN')).toBe('处理中...');
|
||||
expect(resolveSecurityText('submitting', 'en-US')).toBe('Processing...');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户