vue请求图片二维码


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 => {
    ...
  })

 

 

 

posted @ 2018-05-31 16:16  sunniejs  阅读(942)  评论(0编辑  收藏  举报