axios请求pdf文件流并下载保存
接口
设置 responseType: 'blob'
1 | function DownloadPdf() { |
保存pdf
1 | const url = URL.createObjectURL(new Blob([data], { type: 'application/pdf;charset-UTF-8' })) |
设置 responseType: 'blob'
1 | function DownloadPdf() { |
1 | const url = URL.createObjectURL(new Blob([data], { type: 'application/pdf;charset-UTF-8' })) |