function downloadByBlob (res: any, fileName: string) {
const blob: any = new Blob([res.data], {
// type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
type: res.headers['content-type']
});
// 非IE下载
const link = document.createElement('a');
link.download = fileName;
link.style.display = 'none';
link.href = URL.createObjectURL(blob);
document.body.appendChild(link);
link.click();
URL.revokeObjectURL(link.href); // 释放URL 对象
document.body.removeChild(link);
}
08-05
3315
09-20
5299
09-26
06-29
6585
06-24
4048
11-19
3398
05-24
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交