Sfoglia il codice sorgente

!627 update ruoyi-ui/src/plugins/download.js.
Merge pull request !627 from Zeno/N/A

若依 2 anni fa
parent
commit
963247df43
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      ruoyi-ui/src/plugins/download.js

+ 4 - 4
ruoyi-ui/src/plugins/download.js

@@ -9,7 +9,7 @@ const baseURL = process.env.VUE_APP_BASE_API
 
 export default {
   name(name, isDelete = true) {
-    var url = baseURL + "/common/download?fileName=" + encodeURI(name) + "&delete=" + isDelete
+    var url = baseURL + "/common/download?fileName=" + encodeURIComponent(name) + "&delete=" + isDelete
     axios({
       method: 'get',
       url: url,
@@ -19,14 +19,14 @@ export default {
       const isLogin = await blobValidate(res.data);
       if (isLogin) {
         const blob = new Blob([res.data])
-        this.saveAs(blob, decodeURI(res.headers['download-filename']))
+        this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
       } else {
         this.printErrMsg(res.data);
       }
     })
   },
   resource(resource) {
-    var url = baseURL + "/common/download/resource?resource=" + encodeURI(resource);
+    var url = baseURL + "/common/download/resource?resource=" + encodeURIComponent(resource);
     axios({
       method: 'get',
       url: url,
@@ -36,7 +36,7 @@ export default {
       const isLogin = await blobValidate(res.data);
       if (isLogin) {
         const blob = new Blob([res.data])
-        this.saveAs(blob, decodeURI(res.headers['download-filename']))
+        this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
       } else {
         this.printErrMsg(res.data);
       }