axios.get(url, {
params: param,
responseType: 'arraybuffer'
}).then((response) => {
loading.close();
const csvData = new Blob([response.data], {type: 'application/x-xlsx'})//response.data要导出的内容
const file_name = 'xxx导出' + '.xlsx';
// for IE
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, file_name);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = file_name;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
}).catch((error) => { })