axios({
method: "POST",
url: "/----/-------",
responseType: "arraybuffer",
data: { ...payload },
}).then((res) => {
const blob = new Blob([res.data]);
const objectURL = URL.createObjectURL(blob);
let btn = document.createElement("a");
btn.download = "-------.xlsx";
btn.href = objectURL;
btn.href = objectURL;
btn.click();
URL.revokeObjectURL(objectURL);
btn = null;
})
文件流转换成需要的文件格式(固定套路)
最新推荐文章于 2024-05-23 16:49:42 发布