- blob转base64
'data:image/png;base64,' + btoa(new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), ''))
注意:请求数据类型,responseType
需要指定为arrayBuffer
- blob转url
URL.createObjectURL(blob)
注意:只能用于img标签
'data:image/png;base64,' + btoa(new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), ''))
注意:请求数据类型,responseType
需要指定为arrayBuffer
URL.createObjectURL(blob)
注意:只能用于img标签