|
|
@@ -468,13 +468,12 @@ function handleVerList() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function desensitizeNumber(number, maskChar = '*') {
|
|
|
+function desensitizeNumber(number, maskChar = '*', leastPadCount = 3) {
|
|
|
// 将数字转换为字符串
|
|
|
let str = number.toString();
|
|
|
- // 如果数字为一位,则不需要脱敏,直接返回
|
|
|
- if (str.length <= 1) return str;
|
|
|
// 保留最后一位,其他位用脱敏字符替换
|
|
|
- return maskChar.repeat(str.length - 1) + str[str.length - 1];
|
|
|
+ let repCount = Math.max(leastPadCount, str.length - 1);
|
|
|
+ return maskChar.repeat(repCount) + str[str.length - 1];
|
|
|
}
|
|
|
|
|
|
function getVerNumByMaskStr(maskStr) {
|