fix(distribution): 分销后台展示完整用户手机号信息
- 后端 ListReceivedListings 移除 owner_phone 脱敏,向分销商返回完整卖家手机号 - 前端 Orders.tsx 移除 maskPhone 遮蔽逻辑,订单列表与收号货架均直接展示真实完整手机号 - 手机号文本支持一键复制,方便分销管理员日常履约联系 - 验证方式:go test 运行通过,npm run build(tsc + vite build)通过
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -114,10 +114,7 @@ const LISTING_STATUS_LABELS: Record<string, { label: string; color: string }> =
|
||||
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) => (
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, whiteSpace: 'nowrap' }}>{row.renter_nickname || '平台租客'}</div>
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12, whiteSpace: 'nowrap' }}>
|
||||
{maskPhone(row.renter_phone)}
|
||||
<Typography.Text type="secondary" copyable={Boolean(row.renter_phone)} style={{ fontSize: 12, whiteSpace: 'nowrap' }}>
|
||||
{row.renter_phone || '-'}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
),
|
||||
@@ -655,8 +652,12 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
|
||||
render: (_: unknown, row: ReceivedListing) => (
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, whiteSpace: 'nowrap' }}>{row.owner_nickname || '匿名卖家'}</div>
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12, whiteSpace: 'nowrap' }}>
|
||||
{maskPhone(row.owner_phone)}
|
||||
<Typography.Text
|
||||
type="secondary"
|
||||
copyable={Boolean(row.owner_phone)}
|
||||
style={{ fontSize: 12, whiteSpace: 'nowrap' }}
|
||||
>
|
||||
{row.owner_phone || '-'}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user