base64编码转图片

axios. post( 'system/getImg', this. $qs. stringify({ filename:_this. imageUrl}),{
    responseType:  'arraybuffer'
})
. then( res  => {
    var  src= 'data:image/png;base64,'btoa(
    new  Uint8Array( res. data). reduce(( databyte=>  data +  String. fromCharCode( byte),  '')
)
    return  src
})

猜你喜欢

转载自blog.csdn.net/qq_37818095/article/details/80333536