首先看下我们接收到的请求:

vue + axios 通过Blob 转换excel文件流 下载乱码问题

 特别注意:responseType: 'blob'

    axios({
        method: 'GET',
        url: '/api',
        params: params,
        responseType: 'blob'
      }).then(res=>{
        let blob = new Blob([res.data], {type: "application/vnd.ms-excel"});
        let url = window.URL.createObjectURL(blob);
        window.location.href = url;
      }).catch(err=>{
        console.log(err)
      })

 参考:vue axios 请求二进制流excel文件,response乱码

vue + axios 通过blob 转换excel文件流 下载乱码问题

vue2.x 下载后台传过来的流文件(excel)后乱码问题(转载)

相关文章:

  • 2021-06-17
  • 2021-10-12
  • 2022-02-14
  • 2022-12-23
  • 2021-05-19
  • 2021-11-23
  • 2021-07-10
猜你喜欢
  • 2021-12-27
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2021-10-04
  • 2022-02-16
相关资源
相似解决方案