From 8de41796fb2d03d568c4ea5bc4ada4bf7720d07f Mon Sep 17 00:00:00 2001 From: jacy <18049821889@163.com> Date: Sun, 16 Aug 2026 08:51:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin,partner,shop,mini,domain):=20?= =?UTF-8?q?=E8=81=94=E7=B3=BB=E7=94=B5=E8=AF=9D=E8=84=B1=E6=95=8F=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=BA=A7=E6=9C=BA=20+=20=E5=A5=97=E9=A4=90=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=A4=9A=E8=A1=8C=E8=BE=93=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - maskPhone/maskContactPhone 支持座机(含区号/分机)脱敏展示,domain 补充单测 - 套餐「使用时间/其他说明」由单行 input 改为多行 textarea(admin/h5-partner/h5-shop) - 后台「套餐审核」标签文字恒为白色(不受 Badge 角标影响) - 新增 deploy/sync-prod-db-to-local.sh:线上库经 SSH 隧道同步至本地(含 @ 密码/base64 解析、--lock-tables=0 兼容受限账号) Co-Authored-By: WorkBuddy --- .../components/AdminStorePackagesSection.tsx | 6 +- apps/admin-web/src/layouts/AdminLayout.tsx | 2 +- apps/admin-web/src/lib/constants.ts | 23 ++- .../src/components/StorePackagesForm.tsx | 32 ++-- .../src/components/ShopPackagesForm.tsx | 6 +- apps/mini-user/src/lib/phone.ts | 34 +++- deploy/sync-prod-db-to-local.sh | 171 ++++++++++++++++++ packages/domain/src/phone.test.ts | 10 + packages/domain/src/phone.ts | 36 ++++ 9 files changed, 294 insertions(+), 26 deletions(-) create mode 100644 deploy/sync-prod-db-to-local.sh diff --git a/apps/admin-web/src/components/AdminStorePackagesSection.tsx b/apps/admin-web/src/components/AdminStorePackagesSection.tsx index 7d8b12e..7f78436 100644 --- a/apps/admin-web/src/components/AdminStorePackagesSection.tsx +++ b/apps/admin-web/src/components/AdminStorePackagesSection.tsx @@ -283,7 +283,8 @@ const AdminStorePackagesSection = forwardRef - updateAt(index, { usableTime: e.target.value })} @@ -303,7 +304,8 @@ const AdminStorePackagesSection = forwardRef - updateAt(index, { otherNotes: e.target.value })} diff --git a/apps/admin-web/src/layouts/AdminLayout.tsx b/apps/admin-web/src/layouts/AdminLayout.tsx index 774836e..857fe0b 100644 --- a/apps/admin-web/src/layouts/AdminLayout.tsx +++ b/apps/admin-web/src/layouts/AdminLayout.tsx @@ -259,7 +259,7 @@ function attachPackageAuditBadge(items: MenuProps['items'], pendingCount: number ...item, label: ( - 套餐审核 + 套餐审核 ), } as MenuItem; diff --git a/apps/admin-web/src/lib/constants.ts b/apps/admin-web/src/lib/constants.ts index 41e52d6..53ccfe6 100644 --- a/apps/admin-web/src/lib/constants.ts +++ b/apps/admin-web/src/lib/constants.ts @@ -140,10 +140,29 @@ export function fmtTime(v?: string | null) { return v ? new Date(v).toLocaleString('zh-CN') : '—'; } -/** 手机号脱敏展示:138****5678;空值返回 — */ +/** 联系电话脱敏:手机 138****5678;座机 0379-****888;空值返回 — */ export function maskPhone(phone?: string | null): string { - const raw = String(phone ?? '').trim(); + const raw = String(phone ?? '').trim().replace(/\s+/g, ''); if (!raw) return '—'; + if (/^1[3-9]\d{9}$/.test(raw)) { + const digits = raw.replace(/\D/g, ''); + return `${digits.slice(0, 3)}****${digits.slice(-4)}`; + } + if (/^0\d{2,3}-?\d{7,8}(-\d{1,6})?$/.test(raw)) { + const extMatch = raw.match(/-(\d{1,6})$/); + const hasExt = !!extMatch && raw.indexOf('-') !== raw.lastIndexOf('-'); + const ext = hasExt ? extMatch![1] : ''; + const main = hasExt ? raw.slice(0, -(ext.length + 1)) : raw; + const digits = main.replace(/\D/g, ''); + const areaLen = digits.startsWith('01') || digits.startsWith('02') ? 3 : 4; + const area = digits.slice(0, areaLen); + const local = digits.slice(areaLen); + const keepTail = Math.min(4, Math.max(2, local.length - 4)); + const maskedLocal = + local.length <= 4 ? '*'.repeat(local.length) : `${'*'.repeat(local.length - keepTail)}${local.slice(-keepTail)}`; + const joiner = main.includes('-') ? '-' : ''; + return ext ? `${area}${joiner}${maskedLocal}-${ext}` : `${area}${joiner}${maskedLocal}`; + } const digits = raw.replace(/\D/g, ''); if (digits.length >= 11) { return `${digits.slice(0, 3)}****${digits.slice(-4)}`; diff --git a/apps/h5-partner/src/components/StorePackagesForm.tsx b/apps/h5-partner/src/components/StorePackagesForm.tsx index 25e678d..988363f 100644 --- a/apps/h5-partner/src/components/StorePackagesForm.tsx +++ b/apps/h5-partner/src/components/StorePackagesForm.tsx @@ -119,15 +119,13 @@ export default function StorePackagesForm({ items, onChange, disabled, embedded
-
- schedule - updateAt(index, { usableTime: e.target.value })} - /> -
+