摘要: let blob = new Blob([response.data], {type: 'application/pdf;charset=UTF-8'}); let fileURL = URL.creatObjectURL(blob) 且将响应头的responseType设置为arraybuffer 阅读全文
posted @ 2020-07-26 16:56 ashen1999 阅读(9165) 评论(1) 推荐(1) 编辑
摘要: 新建一个a标签,设置不显示在页面中,download属性,添加给body,并在下载后移除 var alink = document.creatElement('a') alink.style.display = 'none' alink.href = fileURL alink.setAttribu 阅读全文
posted @ 2020-07-26 16:48 ashen1999 阅读(268) 评论(0) 推荐(0) 编辑