axios
.get('/captcha', {
params: param,
responseType: 'arraybuffer'
})
.then(response => {
return 'data:image/png;base64,' + btoa(
new Uint8Array(response.data)
.reduce((data, byte) => data + String.fromCharCode(byte), '')
);
}).then(data => {
...
})
请求来的文件流转换为图片
axios.get('/captcha', {params: param,responseType: 'arraybuffer'}).then(response => {return 'data:image/png;base64,' + btoa(new Uint8Array(response.data).re...
·
更多推荐
已为社区贡献7条内容
所有评论(0)