axios({
method: "POST",
url: url,
data: data,
params: data,
responseType: 'blob'
}).then(response => {
download(response, data)
})
function download (res) {
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
const blobURL = window.URL.createObjectURL(blob)
const tempLink = document.createElement('a')
tempLink.style.display = 'none'
tempLink.href = blobURL
tempLink.setAttribute('download', decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]))
if (typeof tempLink.download === 'undefined') {
tempLink.setAttribute('target', '_blank')
}
document.body.appendChild(tempLink)
tempLink.click()
document.body.removeChild(tempLink)
window.URL.revokeObjectURL(blobURL)
}