**
通过Blob流在浏览器中打开pdf文件
**
const url = `/eehds/epidemic/print?taskId=${this.taskId}&isPrint=true` axios({ method: 'get', url: url, headers: {}, responseType: 'blob', }).then(response => { let blob = new Blob([response.data], { type: 'application/pdf;charset=utf-8' }) let href = window.URL.createObjectURL(blob) //创建下载的链接 window.open(href) })
来源地址:https://blog.csdn.net/qq_41985405/article/details/126967402