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 || '-'}
),