wenhandi

 解法:

//axios
  return request({
  url: "/saleUnit/exportSaleUnit",
  headers: {
    "biz-source-param": "BLG"
  },
  method: "post",
  responseType: "blob",
  data: params
 });

let blob = new Blob([res], { type: "application/x-xls" }); let link = document.createElement("a"); link.href = window.URL.createObjectURL(blob); link.download = `便利购商品列表${this.$dayjs().format(   "YYYYMMDDHHmmss" )}.xlsx`; link.click(); this.$message.success("下载成功!");

 

 

 

服务端返回的数据截图

响应头

前端下载脚本

下载的excel

wps打开失败

 

分类:

技术点:

相关文章:

  • 2021-12-20
  • 2021-12-04
  • 2022-12-23
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-11
猜你喜欢
  • 2021-12-25
  • 2022-12-23
  • 2022-02-15
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案