1、请求方式
axios({ url: '请求地址', responseType: 'arraybuffer', method: 'get/post', params: { ...data } })
2、展示方式
两种展示方式任意选择
1、const url = URL.createObjectURL(new Blob([res])) // 这种方法需要图片服务器不要添加限制
2、const url = `data:image/png;base64,${btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ''))}`
网友评论