fix: 删除无用命名,更新了一些细节
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled

This commit is contained in:
2025-08-28 11:00:39 +08:00
parent 6f8f87fb09
commit 920b47aace
44 changed files with 345 additions and 117 deletions

View File

@@ -275,7 +275,8 @@ export function desensitize(data: string, type: 'bankCard' | 'idCard'): string {
case 'bankCard': {
// 银行卡号脱敏规则显示前6位和后4位中间用*代替
if (data.length < 12) {
throw new Error('Invalid bank card number length');
return data.replace(/(.{6}).*(.{4})/, '$1******$2');
// throw new Error('Invalid bank card number length');
}
return data.slice(0, 6) + '*'.repeat(data.length - 10) + data.slice(-4);
}