From 6d34f867654de328a18e125297a1dc13acf418ff Mon Sep 17 00:00:00 2001 From: yml2213 Date: Sat, 10 Oct 2026 14:18:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(distribution):=20=E5=88=86=E9=94=80?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=B1=95=E7=A4=BA=E5=AE=8C=E6=95=B4=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=89=8B=E6=9C=BA=E5=8F=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 后端 ListReceivedListings 移除 owner_phone 脱敏,向分销商返回完整卖家手机号 - 前端 Orders.tsx 移除 maskPhone 遮蔽逻辑,订单列表与收号货架均直接展示真实完整手机号 - 手机号文本支持一键复制,方便分销管理员日常履约联系 - 验证方式:go test 运行通过,npm run build(tsc + vite build)通过 --- .../internal/modules/distribution/repository.go | 6 +----- distribution-admin/src/pages/Orders.tsx | 17 +++++++++-------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/backend/internal/modules/distribution/repository.go b/backend/internal/modules/distribution/repository.go index eb869c5..88cbd88 100644 --- a/backend/internal/modules/distribution/repository.go +++ b/backend/internal/modules/distribution/repository.go @@ -2984,10 +2984,6 @@ func (r *Repository) ListReceivedListings(ctx context.Context, adminID, siteID u items := make([]ReceivedListingDTO, 0, len(rows)) for _, r := range rows { - maskedPhone := r.OwnerPhone - if len(maskedPhone) >= 7 { - maskedPhone = maskedPhone[:3] + "****" + maskedPhone[len(maskedPhone)-4:] - } status := r.Status if r.DisplayStatus == "disabled" { status = "offline" @@ -2999,7 +2995,7 @@ func (r *Repository) ListReceivedListings(ctx context.Context, adminID, siteID u SiteID: r.DistributionSiteID, AccountID: r.AccountID, OwnerID: r.OwnerID, - OwnerPhone: maskedPhone, + OwnerPhone: r.OwnerPhone, OwnerNickname: r.OwnerUsername, Title: r.Title, GameName: r.GameName, diff --git a/distribution-admin/src/pages/Orders.tsx b/distribution-admin/src/pages/Orders.tsx index 4ec91a5..47ff768 100644 --- a/distribution-admin/src/pages/Orders.tsx +++ b/distribution-admin/src/pages/Orders.tsx @@ -114,10 +114,7 @@ const LISTING_STATUS_LABELS: Record = draft: { label: '草稿', color: 'warning' }, } -function maskPhone(phone?: string): string { - if (!phone || phone.length < 7) return phone || '-' - return phone.slice(0, 3) + '****' + phone.slice(-4) -} + function formatGameName(gameName?: string): string { if (!gameName) return '' @@ -396,8 +393,8 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) { render: (_: unknown, row: DistributionOrder) => (
{row.renter_nickname || '平台租客'}
- - {maskPhone(row.renter_phone)} + + {row.renter_phone || '-'}
), @@ -655,8 +652,12 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) { render: (_: unknown, row: ReceivedListing) => (
{row.owner_nickname || '匿名卖家'}
- - {maskPhone(row.owner_phone)} + + {row.owner_phone || '-'}
),