You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
291 B
9 lines
291 B
/**
|
|
* @description: 隐藏手机号码中的几位数字加密显示
|
|
* @param {String} phone
|
|
* @return {String}
|
|
* @example privatePhone('15234856547') // 152****6547
|
|
*/
|
|
export default function privatePhone(phone) {
|
|
return ('' + phone).replace(/^(\d{3})\d{4}(\d{4})$/g, '$1****$2');
|
|
}
|
|
|