https://zhuanlan.zhihu.com/p/32909043
https://blog.csdn.net/WU5229485/article/details/85219165
export function exportExel(options: any) {
fetch('/api/order/exportExcel')
.then(res => res.blob())
.then(blob => {
// 通过 blob 对象获取对应的 url
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
const fileName = 'sell-order.xls';
a.download = fileName;
a.href = url;
document.body.appendChild(a);
a.click();
a.remove(); // document.body.removeChild(a)
})
.catch(err => {
console.error(err);
});
}