Browse Source

!89 update ruoyi-ui/src/utils/zipdownload.js.
Merge pull request !89 from ytzjf/N/A

若依 4 years ago
parent
commit
d8896c9054
1 changed files with 2 additions and 0 deletions
  1. 2 0
      ruoyi-ui/src/utils/zipdownload.js

+ 2 - 0
ruoyi-ui/src/utils/zipdownload.js

@@ -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
 }