HTTP({
method: 'post',
url: '',
data: {
ids: this.state.selectArr.length ? this.state.selectArr : null,
},
responseType: 'arraybuffer'
}).then(res=>{
const url = window.URL.createObjectURL(
new Blob([res], {
type:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
);
const link = document.createElement('a');
link.href = url;
link.setAttribute(
'download',
`文件标题${moment().format('YYYY-MM-DD')}`
);
document.body.appendChild(link);
link.click();