async inspectionResultBinDingData(data, errorMessageMode = 'Notice') {
const response = await ajax.request({
responseType: 'blob',
errorMessageMode,
url: `/api/SI/inspectionRecordExport/inspectionResultBinDingData`,
method: 'post',
data: data
})
var blob = new Blob([response.data])
var downloadElement = document.createElement('a')
var href = window.URL.createObjectURL(blob) // 创建下载的链接
downloadElement.href = href
downloadElement.download = decodeURIComponent(
response.headers['content-disposition'].match(/filename\*=UTF-8''(.*)$/)[1]
)
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement)
window.URL.revokeObjectURL(href)
}
前端处理后台返回的json 文件下载
最新推荐文章于 2024-07-22 16:46:50 发布
关键词由CSDN通过智能技术生成