ajax
$.ajax({
type: 'get',
responseType: 'blob',
xhrFields: {
withCredentials: true // 这里设置了withCredentials
},
url: `${api_url}/base/downloadsExcelDown?tenderId=` + this.tenderingValue,
success: function (res) {
let link = document.createElement("a");
link.href = window.URL.createObjectURL(new Blob([res]))
link.target = "_blank"
link.download = "专家列表.xls"
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
},
error: function (err) {
console.log(err)
}
})