循环后台返回的数据,把手机号进行脱敏
this.mobile = item.mobile.replace(item.mobile.substring(3, 7),'***')
this.mobile是我在data中定义的,然后通过{{}}进行绑定
getAction(url).then((res) => {
console.log("列表排名",res)
if (res.success) {
if (res.result.length > 0) {
this.listranking = res.result
res.result.forEach((item)=>{
this.mobile = item.mobile.replace(item.mobile.substring(3, 7),'***')
console.log("shoujiaho脱敏",this.mobile)
})
}
}
})