res.data.pdfFilePath是我的文件路径 ,复制后改掉这个路径即可使用啦
let url = window.URL.createObjectURL(new Blob([res.data.pdfFilePath]))
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', res.data.pdfFilePath)
document.body.appendChild(link)
link.click()
//释放URL对象所占资源
window.URL.revokeObjectURL(url)
//用完即删
document.body.removeChild(link)插入代码片