正在显示
1 个修改的文件
包含
2 行增加
和
0 行删除
| @@ -32,9 +32,11 @@ export function resolveBlob(res, mimeType) { | @@ -32,9 +32,11 @@ export function resolveBlob(res, mimeType) { | ||
| 32 | var result = patt.exec(contentDisposition) | 32 | var result = patt.exec(contentDisposition) |
| 33 | var fileName = result[1] | 33 | var fileName = result[1] |
| 34 | fileName = fileName.replace(/\"/g, '') | 34 | fileName = fileName.replace(/\"/g, '') |
| 35 | + aLink.style.display = 'none' | ||
| 35 | aLink.href = URL.createObjectURL(blob) | 36 | aLink.href = URL.createObjectURL(blob) |
| 36 | aLink.setAttribute('download', fileName) // 设置下载文件名称 | 37 | aLink.setAttribute('download', fileName) // 设置下载文件名称 |
| 37 | document.body.appendChild(aLink) | 38 | document.body.appendChild(aLink) |
| 38 | aLink.click() | 39 | aLink.click() |
| 40 | + URL.revokeObjectURL(aLink.href);//清除引用 | ||
| 39 | document.body.removeChild(aLink); | 41 | document.body.removeChild(aLink); |
| 40 | } | 42 | } |
-
请 注册 或 登录 后发表评论