examineClick(index, tableData, id) { // 触发事件
axios({
method: 'post',
url: `***`, // 接口
responseType: 'blob'
}).then((res) => {
if (!res) { return }
let blob = new Blob([res.data], {
type: "application/zip" //文件为zip格式
});
let contentDisposition = res.headers['content-disposition'];
// 运用window.decodeURI来解码,解决中文乱码问题
let fileName = window.decodeURI(contentDisposition.substring(contentDisposition.indexOf('=')+1))
let url = window.URL.createObjectURL(blob)
let rotate = document.createElement('a')
rotate.style.display = 'none'
rotate.href = url
rotate.setAttribute('download', fileName) //获取文件名称
document.body.appendChild(rotate)
rotate.click()
})
}