加强:
//对img添加额外数据
if (node.tag === 'img') {
if (node.attr.src.indexOf("http") == -1){
node.imgIndex = results.images.length;
var imgUrl = "http://www.yudw.com/" + node.attr.src;
if (imgUrl[0] == '') {
imgUrl.splice(0, 1);
}
imgUrl = wxDiscode.urlToHttpUrl(imgUrl, __placeImgeUrlHttps);
node.attr.src = imgUrl;
node.from = bindName;
results.images.push(node);
results.imageUrls.push(imgUrl);
}
}
如果html中带有img标签,则给img标签加上前缀
【虽然这一步也可以在后端的接口中处理】
标签:node,src,attr,img,微信,程序,results,html,imgUrl From: https://blog.51cto.com/jing/6002492