From a69bf92c8907eb1fed227afb156ff0e1c5821c24 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期日, 19 十月 2025 16:16:12 +0800
Subject: [PATCH] fix: bug
---
packages/utils/common.ts | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/packages/utils/common.ts b/packages/utils/common.ts
index 238407e..a02170f 100644
--- a/packages/utils/common.ts
+++ b/packages/utils/common.ts
@@ -133,5 +133,23 @@
export const hiddenIDNumberForEnd6 = (realIDNumber: string) => {
if (!realIDNumber) return '';
- realIDNumber.replace(/^(\d+)(.{6})$/, '$1******');
+ return realIDNumber.replace(/^(\d+)(.{6})$/, '$1******');
};
+
+export const showBankCodeForEnd4 = (bankCode: string) => {
+ if (!bankCode) return '';
+ return '*'.repeat(Math.max(0, bankCode.length - 4)) + bankCode.slice(-4);
+};
+
+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