1.正则取出字符串中的图片地址 var reg = /https:\/\/.*?(gif|png|jpg)/gi; console.log(res.data.result.companyImgUrl.match(reg)); this.companyImgUrl = res.data.result.companyImgUrl.match(reg); console.log(this.companyImgUrl[0]);