Axios设置:
axios.get('url',{
params:{
b: ''
},
responseType: 'arraybuffer' //这里是声明期望返回的数据类型,为arraybuffer
}).then(res => {
const bufferUrl = btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ''));
const imgURL = 'data:image/png;base64,' + bufferUrl;//imgURL就是最后的图片base64数据
})