speeches.exportChat(obj).then(res =>{
console.log('res',res)
//res是文件流
const blob = new Blob([res],{type: 'application/octet-stream'})
const url = URL.createObjectURL(blob)
const link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download",'名字.xlsx');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}).catch(err =>{
console.log(err)
})
vue 下载xlsx 文件
最新推荐文章于 2024-06-28 16:20:01 发布