From e81a93e56fc382b3f4efc26425a4e894a12d5907 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期三, 13 八月 2025 09:54:08 +0800
Subject: [PATCH] feat: 接口对接
---
packages/utils/common.ts | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/packages/utils/common.ts b/packages/utils/common.ts
index e6344d5..bd11db4 100644
--- a/packages/utils/common.ts
+++ b/packages/utils/common.ts
@@ -53,6 +53,7 @@
* @returns
*/
export function addStarForString(str: string, start = 0, end = 0) {
+ if (!str) return '';
return str.substring(0, start) + '*'.repeat(end - start) + str.substring(end);
}
@@ -129,3 +130,6 @@
export function filterJoin(list: any[], separator = '-') {
return list.filter(Boolean).join(separator);
}
+
+export const hiddenIDNumberForEnd6 = (realIDNumber: string) =>
+ realIDNumber.replace(/^(\d+)(.{6})$/, '$1******');
--
Gitblit v1.9.1