let blob = new Blob([res]);
const url = window.URL.createObjectURL(blob);
const link = window.document.createElement("a");
link.href = url;
let filename = "XXX.doc";//文件名以及后缀
let decodeURL = decodeURIComponent(filename);
link.download = decodeURL;
link.style.display = "none";
link.click();
前端下载后端文件流
最新推荐文章于 2024-05-18 11:09:56 发布