const content = res.data; //后端返回的数据
let url = window.URL.createObjectURL(content)
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('id', 'downloadLink')
var date =
new Date().getFullYear() +
"" +
(new Date().getMonth() + 1) +
"" +
new Date().getDate();
link.setAttribute('download', date+'.xls')
document.body.appendChild(link)
// 删除添加的a链接
let objLink = document.getElementById('downloadLink')
objLink.click();
document.body.removeChild(objLink)
// 释放内存
window.URL.revokeOjbectURL(url)