手机号中间隐藏为****

//电话加密
  function geTel(phone) {
    let NewPhone = phone.toString();
    var reg = /^(\d{3})\d{4}(\d{4})$/;
    return NewPhone.replace(reg, '$1****$2');
  }
geTel(phone)
posted @ 2022-03-17 11:12  xuelin  阅读(72)  评论(0编辑  收藏  举报