feat: 同步管理端、用户端与后端业务,并接通线上 Web 接口
补齐平台订阅、外部登录、CRM 同步与用户端页面;Nginx 转发用户端接口,登录页使用 Google 与 Apple 标志。 Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
@@ -105,12 +105,54 @@ test('4. card/articles 语言包必须包含中英文案与 OpenGraph 预览词
|
||||
|
||||
assert.ok(content.includes("'en-US'"), '必须包含 en-US');
|
||||
assert.ok(content.includes("'zh-CN'"), '必须包含 zh-CN');
|
||||
assert.ok(content.includes("'ar-SA'"), '必须包含 ar-SA');
|
||||
assert.ok(content.includes('cardArticles.title'), '必须包含页面标题文案');
|
||||
assert.ok(content.includes('cardArticles.action.add'), '必须包含新增文章主 CTA 文案');
|
||||
assert.ok(content.includes('cardArticles.ogPreview.title'), '必须包含 OG 社交预览卡文案');
|
||||
assert.ok(
|
||||
content.includes('cardArticles.form.cardId.placeholder'),
|
||||
'必须包含名片编号占位文案'
|
||||
);
|
||||
assert.ok(
|
||||
content.includes('cardArticles.form.title.placeholder'),
|
||||
'必须包含标题占位文案'
|
||||
);
|
||||
assert.ok(
|
||||
content.includes('cardArticles.form.summary.placeholder'),
|
||||
'必须包含摘要占位文案'
|
||||
);
|
||||
assert.ok(
|
||||
content.includes('cardArticles.form.content.placeholder'),
|
||||
'必须包含正文占位文案'
|
||||
);
|
||||
assert.ok(!/\bany\b/.test(content), '语言包禁止使用 any');
|
||||
});
|
||||
|
||||
test('4b. card/articles 表单占位必须走 locale,禁止硬编码中文 placeholder', () => {
|
||||
const content = fs.readFileSync(articlesPagePath, 'utf-8');
|
||||
assert.ok(
|
||||
content.includes("t['cardArticles.form.cardId.placeholder']"),
|
||||
'cardId 占位必须使用 locale'
|
||||
);
|
||||
assert.ok(
|
||||
content.includes("t['cardArticles.form.title.placeholder']"),
|
||||
'标题占位必须使用 locale'
|
||||
);
|
||||
assert.ok(
|
||||
content.includes("t['cardArticles.form.summary.placeholder']"),
|
||||
'摘要占位必须使用 locale'
|
||||
);
|
||||
assert.ok(
|
||||
content.includes("t['cardArticles.form.content.placeholder']"),
|
||||
'正文占位必须使用 locale'
|
||||
);
|
||||
assert.ok(
|
||||
!/placeholder=["'][^"']*[\u4e00-\u9fff]/.test(content),
|
||||
'禁止硬编码含中文的 placeholder'
|
||||
);
|
||||
assert.ok(!content.includes('placeholder="101"'), '禁止硬编码 cardId 示例占位');
|
||||
});
|
||||
|
||||
test('5. card/articles 必须支持 OpenGraph 社交卡片多比例切换 (1.91:1 / 1:1)', () => {
|
||||
const content = fs.readFileSync(articlesPagePath, 'utf-8');
|
||||
assert.ok(content.includes('Radio'), '必须使用 Arco Radio 组件进行卡片比例切换');
|
||||
@@ -120,3 +162,50 @@ test('5. card/articles 必须支持 OpenGraph 社交卡片多比例切换 (1.91:
|
||||
assert.ok(localeContent.includes('cardArticles.ogPreview.landscape'), '语言包必须包含横版比例文案');
|
||||
assert.ok(localeContent.includes('cardArticles.ogPreview.square'), '语言包必须包含方版比例文案');
|
||||
});
|
||||
|
||||
test('6. 无封面时 OG 预览必须显示 locale 空图占位,禁止默认假图/假 CDN/示例封面', () => {
|
||||
const content = fs.readFileSync(articlesPagePath, 'utf-8');
|
||||
const localeContent = fs.readFileSync(articlesLocalePath, 'utf-8');
|
||||
|
||||
assert.ok(
|
||||
content.includes("t['cardArticles.ogPreview.emptyImage']"),
|
||||
'无封面时必须使用 locale 空图占位文案'
|
||||
);
|
||||
assert.ok(!content.includes('>OG Image<'), '禁止硬编码 OG Image 占位文案');
|
||||
assert.ok(
|
||||
/ogPreview\.image\s*\?/.test(content) || /\{ogPreview\.image\s*\?/.test(content),
|
||||
'必须仅在有真实封面 URL 时渲染 img'
|
||||
);
|
||||
|
||||
// 禁止默认假图、假 CDN、示例封面地址
|
||||
const fakeImagePatterns = [
|
||||
/unsplash\.com/i,
|
||||
/picsum\.photos/i,
|
||||
/placeholder\.com/i,
|
||||
/placehold\.co/i,
|
||||
/via\.placeholder/i,
|
||||
/dummyimage\.com/i,
|
||||
/loremflickr\.com/i,
|
||||
/example\.com\/.*\.(png|jpe?g|webp|gif)/i,
|
||||
/cdn\.example/i,
|
||||
/default[-_]?cover/i,
|
||||
/sample[-_]?cover/i,
|
||||
/fake[-_]?cover/i,
|
||||
/src=["']https?:\/\/[^"']*cover[^"']*["']/i,
|
||||
/src=["']\/assets\/[^"']*cover/i,
|
||||
];
|
||||
for (const pattern of fakeImagePatterns) {
|
||||
assert.ok(!pattern.test(content), `页面禁止假图/示例封面地址: ${pattern}`);
|
||||
}
|
||||
|
||||
assert.ok(
|
||||
localeContent.includes('cardArticles.ogPreview.emptyImage'),
|
||||
'语言包必须包含空图占位文案 key'
|
||||
);
|
||||
// 三语均需有 emptyImage 词条
|
||||
const emptyImageMatches = localeContent.match(/cardArticles\.ogPreview\.emptyImage/g) || [];
|
||||
assert.ok(
|
||||
emptyImageMatches.length >= 3,
|
||||
'en-US / zh-CN / ar-SA 均须包含 emptyImage 词条'
|
||||
);
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户