示例
Common.downloadFile = (content, title) => {
var a = document.createElement("a");
var blob = new Blob([content], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = title;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
//使用
this.Common.downloadFile(res,"认证信息")
//响应类型
responseType: 'blob'
下载方式
https://www.cnblogs.com/zhilingege/p/8253702.html
网友评论