axios({
method: 'post',
url: 'https://.........../statistical/exportExcel',
data: params,
responseType: 'blob',
}).then(res => {
console.debug(res);
const _href = URL.createObjectURL(res.request.response);
const aLink = document.createElement('a');
aLink.style.display = 'none';
aLink.href = _href;
aLink.setAttribute('download', '产品配置' + '.xlsx');
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink);
URL.revokeObjectURL(_href);
}).catch((error) => {
console.log(error)
})
axios下载excell
最新推荐文章于 2024-03-20 09:10:15 发布