1、以二进制流格式请求 responseType:'arraybuffer'
2、处理二进制流 btoa(new Unit8Array(data)).reduce((data,byte)=>data + String.fromCharCode(byte),''));最终得到图片路径
'data:image/png;base64,' + btoa(new Unit8Array(data)).reduce((data,byte)=>data + String.fromCharCode(byte),''));
例:this.$http.get(url,{responseType,parames}).then(function(res){
if(res.data){
let tempUrl = btoa(new Unit8Array(data)).reduce((data,byte)=>data + String.fromCharCode(byte),''));
let ImageUrl = 'data:image/png;base64,' + tempUrl;
}
})