前端处理后台返回二进制流乱码图片

axios.get('/url', {
        responseType: 'arraybuffer'
      }).then(response => {
        return 'data:image/png;base64,' + btoa(
          new Uint8Array(response.data).reduce((data, byte) => data + String.fromCharCode(byte), '')
        )
      }).then(data => {
        this.img = data
      })

你可能感兴趣的:(前端处理后台返回二进制流乱码图片)