不特意限定类型,把文件类型拼在文件名后面就好,比如: 文章名.txt
RecoverListExcel(params).then(res => {
let fileName = decodeURI(res.headers['filename'])
const url = window.URL.createObjectURL(new Blob([res.data]));
const link = document.createElement('a');
link.style.display = "none";
link.href = url;
link.setAttribute('download', fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
})
RecoverListExcel接口名