export const downloadFile = (url, fileName = '表格.xlsx') => {
axios({
url: url,
headers: {
},
responseType: 'blob',
}).then(res => {
const content = res
const blob = new Blob([content])
if ('download' in document.createElement('a')) {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
} else {
navigator.msSaveBlob(blob, fileName)
}
})
}