axios({
method:'get',
url:'',
params:{},
headers:{},
//响应方式
responseType:'blob'
}).then(res=>{
let data = res.data;
let url = window.URL.createObjectURL(new Blob([data]))
let a = document.createElement('a')
// 后台返的文件名,根据实际情况而定
let fileName = decodeURI(response.headers["content-disposition"].split(";")[2].split('=')[1].split(' ')[2]);
a.style.display = 'none'
a.href = url;
a.setAttribute('download',fileName )
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
})