iframe显示微信公众号文章

iframe显示微信公众号文章

vue + axios 解决微信图文防盗链方案

 let showSrc = 'https://cors-anywhere.herokuapp.com/'+微信公众号地址; //协议名根据实际情况决定
 this.$http.get( showSrc ).then((response)=>{
   let html = response.data;
   html = html.replace(/data-src/g, "src")
   		.replace(/)<[^<]*)*<\/script>/g, '')
   		.replace(/https/g,'http');
   let html_src = 'data:text/html;charset=utf-8,' + html;
   let iframe = document.getElementById('iFrame');
   iframe.src = html_src;
 },(err)=>{console.log(err);});

你可能感兴趣的:(微信公众号)