From 9c2d72eee4ac74107b5cb196d6c0af147a3039d0 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期五, 12 九月 2025 14:19:29 +0800 Subject: [PATCH] fix: bug --- packages/utils/common.ts | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/packages/utils/common.ts b/packages/utils/common.ts index cbf1993..a420b99 100644 --- a/packages/utils/common.ts +++ b/packages/utils/common.ts @@ -135,3 +135,16 @@ if (!realIDNumber) return ''; return realIDNumber.replace(/^(\d+)(.{6})$/, '$1******'); }; + +export const hiddenPhone = (phone: string) => { + if (!phone) return ''; + return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'); +}; + +export function filterCN(str: string) { + return str.replace(/[\u4e00-\u9fa5]/gi, ''); +} + +export function filterNotCN(str: string) { + return str.replace(/[^\u4e00-\u9fa5]/gi, ''); +} -- Gitblit v1.9.1