From fdafe8d7475dee96c3a2e79867552d5d96f0c71f Mon Sep 17 00:00:00 2001 From: kdletters <61648117+kdletters@users.noreply.github.com> Date: Fri, 5 Jun 2026 00:51:43 +0800 Subject: [PATCH] fix: allow masked phone author display --- .../【玩法创作】平台入口与玩法链路-2026-05-15.md | 2 +- .../rpg-entry/rpgEntryWorldPresentation.test.ts | 16 +++++++++++++--- .../rpg-entry/rpgEntryWorldPresentation.ts | 3 --- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/【玩法创作】平台入口与玩法链路-2026-05-15.md b/docs/【玩法创作】平台入口与玩法链路-2026-05-15.md index 53ce1a7c..fa82cc45 100644 --- a/docs/【玩法创作】平台入口与玩法链路-2026-05-15.md +++ b/docs/【玩法创作】平台入口与玩法链路-2026-05-15.md @@ -60,7 +60,7 @@ 10. 敲木鱼作品架读取当前用户作品列表时走 `GET /api/creation/wooden-fish/works`;发布成功后平台壳必须同时刷新作品架与公开广场,避免作品刚发布时仍停留在旧列表。 11. 移动端草稿页整体禁止长按选择文字,避免误触系统选区;输入框、文本域和可编辑区域仍必须保留文本选择能力。 -发现页 / 推荐页公开作品卡的作者行只显示可读公开昵称;不得把手机号掩码、`SY-*` 陶泥号或作品号拼接进卡片作者名。陶泥号搜索、作品号复制和完整作品身份只在搜索、详情页或明确的复制入口展示,避免卡片列表暴露账号标识。 +发现页 / 推荐页公开作品卡的作者行只显示公开昵称或账号生成的脱敏手机号;不得把纯 `SY-*` 陶泥号或作品号当作卡片作者名。陶泥号搜索、作品号复制和完整作品身份只在搜索、详情页或明确的复制入口展示,避免卡片列表暴露额外账号标识。 发现 Tab、创作 Tab 与草稿 Tab 的页面根内容区不再套 `platform-page-stage` 外层全局卡片壳,让列表、筛选和玩法卡获得更宽的横向空间;推荐页和我的页仍按各自页面设计保留原有全局卡片口径。移动端“我的”页仍按顶部头像 / 昵称 / 陶泥号、会员横幅、三张统计卡、每日任务、五项常用功能宫格、设置入口和法律信息组织,不保留旧的底部“填邀请码”次级入口;常用功能当前只展示四项常驻入口时必须按四列铺满整行,不保留五列网格导致左对齐空位;每日任务卡必须读取 `/api/profile/tasks` 的当前任务摘要并在领取后同步刷新卡片进度。字号必须维持平台普通 UI 档位,不能因为窄屏把卡片标题、功能 label 或法律信息撑成展示级字号;最后一屏内容必须能在底部 dock 上方完整滚动露出,不得被固定底部导航遮挡。 diff --git a/src/components/rpg-entry/rpgEntryWorldPresentation.test.ts b/src/components/rpg-entry/rpgEntryWorldPresentation.test.ts index 765d4436..bd126a10 100644 --- a/src/components/rpg-entry/rpgEntryWorldPresentation.test.ts +++ b/src/components/rpg-entry/rpgEntryWorldPresentation.test.ts @@ -237,7 +237,7 @@ test('resolves public work author from display name and public user code before expect(resolvePlatformWorkAuthorDisplayName(card, null)).toBe('敲木鱼玩家'); }); -test('public work author display hides phone masks and public user codes on cards', () => { +test('public work author display keeps phone masks and hides bare public user codes on cards', () => { const card = mapWoodenFishWorkToPlatformGalleryCard({ publicWorkCode: 'WF-AUTHOR2', workId: 'wooden-fish-work-author-mask', @@ -263,8 +263,18 @@ test('public work author display hides phone masks and public user codes on card displayName: '158****3533', avatarUrl: null, }), - ).toBe('玩家'); - expect(resolvePlatformWorkAuthorDisplayName(card, null)).toBe('玩家'); + ).toBe('158****3533'); + expect(resolvePlatformWorkAuthorDisplayName(card, null)).toBe( + '158****3533 · SY-00000003', + ); + + const publicCodeOnlyCard = { + ...card, + authorDisplayName: 'SY-00000003', + }; + expect(resolvePlatformWorkAuthorDisplayName(publicCodeOnlyCard, null)).toBe( + '玩家', + ); }); test('keeps baby object match public card code and template label intact', () => { diff --git a/src/components/rpg-entry/rpgEntryWorldPresentation.ts b/src/components/rpg-entry/rpgEntryWorldPresentation.ts index ff4b511e..302273a6 100644 --- a/src/components/rpg-entry/rpgEntryWorldPresentation.ts +++ b/src/components/rpg-entry/rpgEntryWorldPresentation.ts @@ -884,9 +884,6 @@ function normalizePlatformPublicAuthorName(value: string | null | undefined) { } const compact = normalized.replace(/\s+/gu, ''); - if (/^\d+\*+\d+(?:[·.-]?SY-\d+)?$/iu.test(compact)) { - return ''; - } if (/^SY-\d+$/iu.test(compact)) { return ''; }