下载文件

412 阅读1分钟

下载返回的pdf文件流

接收方式
responseType: 'blob'

download((new Blob([res])), file_name, 'application/pdf')

下载返回的url

 const a = document.createElement('a'); // 创建a标签
 a.setAttribute('download', res.data.url);// download属性
 a.setAttribute('href', res.data.url);// href链接
 a.click();// 自执行点击事件