From b082da73a1e0259738ccb33ebf7d80cad3dc3a10 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 27 九月 2021 17:27:32 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into satoken

---
 ruoyi-ui/src/views/monitor/job/log.vue                                          |    2 
 ruoyi-ui/src/views/tool/gen/index.vue                                           |    3 
 ruoyi-ui/src/views/demo/demo/index.vue                                          |    2 
 ruoyi-common/src/main/java/com/ruoyi/common/enums/ThreadPoolRejectedPolicy.java |    2 
 ruoyi-ui/src/views/system/role/index.vue                                        |    2 
 ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java           |    1 
 ruoyi-ui/src/views/system/user/index.vue                                        |    4 
 ruoyi-ui/src/views/system/dict/index.vue                                        |    2 
 ruoyi-ui/package.json                                                           |    4 
 ruoyi-ui/src/main.js                                                            |    2 
 ruoyi-ui/src/plugins/index.js                                                   |    3 
 ruoyi-ui/src/views/monitor/logininfor/index.vue                                 |    2 
 ruoyi-ui/src/views/system/post/index.vue                                        |    2 
 ruoyi-ui/src/views/system/dict/data.vue                                         |    2 
 ruoyi-ui/src/utils/ruoyi.js                                                     |    2 
 ruoyi-generator/src/main/resources/vm/vue/index.vue.vm                          |    2 
 ruoyi-admin/src/main/resources/application.yml                                  |    2 
 ruoyi-ui/src/views/monitor/job/index.vue                                        |    2 
 ruoyi-ui/src/views/monitor/operlog/index.vue                                    |    2 
 ruoyi-ui/src/views/system/oss/index.vue                                         |    3 
 README.md                                                                       |    3 
 ruoyi-ui/src/views/system/config/index.vue                                      |    2 
 /dev/null                                                                       |   91 ----------------------
 ruoyi-ui/src/views/tool/build/index.vue                                         |   19 +---
 ruoyi-ui/src/plugins/download.js                                                |   71 +++++++++++++++++
 25 files changed, 100 insertions(+), 132 deletions(-)

diff --git a/README.md b/README.md
index a7957e5..c103879 100644
--- a/README.md
+++ b/README.md
@@ -6,8 +6,9 @@
 <br>
 [![RuoYi-Vue-Plus](https://img.shields.io/badge/RuoYi_Vue_Plus-3.1.0-success.svg)](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus)
 [![Spring Boot](https://img.shields.io/badge/Spring%20Boot-2.5-blue.svg)]()
-[![JDK-8+](https://img.shields.io/badge/JDK-8+-green.svg)]()
+[![JDK-8+](https://img.shields.io/badge/JDK-8-green.svg)]()
 [![JDK-11](https://img.shields.io/badge/JDK-11-green.svg)]()
+[![JDK-17](https://img.shields.io/badge/JDK-17-green.svg)]()
 
 RuoYi-Vue-Plus 鏄熀浜� RuoYi-Vue 閽堝 `鍒嗗竷寮忛泦缇 鍦烘櫙鍗囩骇(涓嶅吋瀹瑰師妗嗘灦)
 
diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
index a3e525c..f75ef29 100644
--- a/ruoyi-admin/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -289,7 +289,7 @@
   # 绾跨▼姹犵淮鎶ょ嚎绋嬫墍鍏佽鐨勭┖闂叉椂闂�
   keepAliveSeconds: 300
   # 绾跨▼姹犲鎷掔粷浠诲姟(鏃犵嚎绋嬪彲鐢�)鐨勫鐞嗙瓥鐣�
-  # CALLER_RUNS_POLICY 绛夊緟
+  # CALLER_RUNS_POLICY 璋冪敤鏂规墽琛�
   # DISCARD_OLDEST_POLICY 鏀惧純鏈�鏃х殑
   # DISCARD_POLICY 涓㈠純
   # ABORT_POLICY 涓
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/ThreadPoolRejectedPolicy.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/ThreadPoolRejectedPolicy.java
index 0c40f34..5529bb3 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/ThreadPoolRejectedPolicy.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/ThreadPoolRejectedPolicy.java
@@ -15,7 +15,7 @@
 @AllArgsConstructor
 public enum ThreadPoolRejectedPolicy {
 
-    CALLER_RUNS_POLICY("绛夊緟", ThreadPoolExecutor.CallerRunsPolicy.class),
+    CALLER_RUNS_POLICY("璋冪敤鏂规墽琛�", ThreadPoolExecutor.CallerRunsPolicy.class),
     DISCARD_OLDEST_POLICY("鏀惧純鏈�鏃х殑", ThreadPoolExecutor.DiscardOldestPolicy.class),
     DISCARD_POLICY("涓㈠純", ThreadPoolExecutor.DiscardPolicy.class),
     ABORT_POLICY("涓", ThreadPoolExecutor.AbortPolicy.class);
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
index dc3aea2..3ab304c 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
@@ -35,6 +35,7 @@
                 .append(percentEncodedFileName);
 
         response.setHeader("Content-disposition", contentDispositionValue.toString());
+        response.setHeader("download-filename", percentEncodedFileName);
     }
 
     /**
diff --git a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
index 99e05c1..05a8baf 100644
--- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
+++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
@@ -573,7 +573,7 @@
 #end
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/${moduleName}/${businessName}/export', this.queryParams);
+        this.#[[$download]]#.excel('/${moduleName}/${businessName}/export', this.queryParams);
     }
   }
 };
diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json
index 58a8c79..d43aee1 100644
--- a/ruoyi-ui/package.json
+++ b/ruoyi-ui/package.json
@@ -42,7 +42,7 @@
     "core-js": "3.8.1",
     "echarts": "4.9.0",
     "element-ui": "2.15.5",
-    "file-saver": "2.0.4",
+    "file-saver": "2.0.5",
     "fuse.js": "6.4.3",
     "highlight.js": "9.18.5",
     "js-beautify": "1.13.0",
@@ -71,7 +71,7 @@
     "eslint-plugin-vue": "7.2.0",
     "lint-staged": "10.5.3",
     "runjs": "4.4.2",
-    "sass": "1.32.0",
+    "sass": "1.42.1",
     "sass-loader": "10.1.0",
     "script-ext-html-webpack-plugin": "2.1.5",
     "svg-sprite-loader": "5.1.1",
diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js
index 6024266..c6306a6 100644
--- a/ruoyi-ui/src/main.js
+++ b/ruoyi-ui/src/main.js
@@ -17,7 +17,6 @@
 import './permission' // permission control
 import { getDicts } from "@/api/system/dict/data";
 import { getConfigKey } from "@/api/system/config";
-import { downLoadExcel } from "@/utils/download";
 import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
 // 鍒嗛〉缁勪欢
 import Pagination from "@/components/Pagination";
@@ -44,7 +43,6 @@
 Vue.prototype.addDateRange = addDateRange
 Vue.prototype.selectDictLabel = selectDictLabel
 Vue.prototype.selectDictLabels = selectDictLabels
-Vue.prototype.downLoadExcel = downLoadExcel
 Vue.prototype.handleTree = handleTree
 
 // 鍏ㄥ眬缁勪欢鎸傝浇
diff --git a/ruoyi-ui/src/plugins/download.js b/ruoyi-ui/src/plugins/download.js
new file mode 100644
index 0000000..248ed01
--- /dev/null
+++ b/ruoyi-ui/src/plugins/download.js
@@ -0,0 +1,71 @@
+import { saveAs } from 'file-saver'
+import axios from 'axios'
+import { getToken } from '@/utils/auth'
+
+const baseURL = process.env.VUE_APP_BASE_API
+
+export default {
+  excel(url, params) {
+    // get璇锋眰鏄犲皠params鍙傛暟
+    if (params) {
+      let urlparams = url + '?';
+      for (const propName of Object.keys(params)) {
+        const value = params[propName];
+        var part = encodeURIComponent(propName) + "=";
+        if (value !== null && typeof(value) !== "undefined") {
+          if (typeof value === 'object') {
+            for (const key of Object.keys(value)) {
+              if (value[key] !== null && typeof (value[key]) !== 'undefined') {
+                let params = propName + '[' + key + ']';
+                let subPart = encodeURIComponent(params) + '=';
+                urlparams += subPart + encodeURIComponent(value[key]) + '&';
+              }
+            }
+          } else {
+            urlparams += part + encodeURIComponent(value) + "&";
+          }
+        }
+      }
+      urlparams = urlparams.slice(0, -1);
+      url = urlparams;
+    }
+    url = baseURL + url
+    axios({
+      method: 'get',
+      url: url,
+      responseType: 'blob',
+      headers: { 'Authorization': 'Bearer ' + getToken() }
+    }).then(res => {
+      const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
+      this.saveAs(blob, decodeURI(res.headers['download-filename']))
+    })
+  },
+  oss(ossId, name) {
+    var url = baseURL + '/system/oss/download/' + ossId
+    axios({
+      method: 'get',
+      url: url,
+      responseType: 'blob',
+      headers: { 'Authorization': 'Bearer ' + getToken() }
+    }).then(res => {
+      const blob = new Blob([res.data], { type: 'application/octet-stream' })
+      this.saveAs(blob, name)
+    })
+  },
+  zip(url, name) {
+    var url = baseURL + url
+    axios({
+      method: 'get',
+      url: url,
+      responseType: 'blob',
+      headers: { 'Authorization': 'Bearer ' + getToken() }
+    }).then(res => {
+      const blob = new Blob([res.data], { type: 'application/zip' })
+      this.saveAs(blob, name)
+    })
+  },
+  saveAs(text, name, opts) {
+    saveAs(text, name, opts);
+  }
+}
+
diff --git a/ruoyi-ui/src/plugins/index.js b/ruoyi-ui/src/plugins/index.js
index 15d829b..a138e6d 100644
--- a/ruoyi-ui/src/plugins/index.js
+++ b/ruoyi-ui/src/plugins/index.js
@@ -1,5 +1,6 @@
 import cache from './cache'
 import modal from './modal'
+import download from './download'
 
 export default {
   install(Vue) {
@@ -7,5 +8,7 @@
     Vue.prototype.$cache = cache
     // 妯℃�佹瀵硅薄
     Vue.prototype.$modal = modal
+    // 涓嬭浇鏂囦欢
+    Vue.prototype.$download = download
   }
 }
diff --git a/ruoyi-ui/src/utils/download.js b/ruoyi-ui/src/utils/download.js
deleted file mode 100644
index 52b07f7..0000000
--- a/ruoyi-ui/src/utils/download.js
+++ /dev/null
@@ -1,91 +0,0 @@
-import axios from 'axios'
-import { getToken } from '@/utils/auth'
-
-const mimeMap = {
-  xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
-  zip: 'application/zip',
-  oss: 'application/octet-stream'
-}
-
-const baseUrl = process.env.VUE_APP_BASE_API
-export function downLoadZip(str, filename) {
-  var url = baseUrl + str
-  axios({
-    method: 'get',
-    url: url,
-    responseType: 'blob',
-    headers: { 'Authorization': 'Bearer ' + getToken() }
-  }).then(res => {
-    resolveBlob(res, mimeMap.zip)
-  })
-}
-
-export function downLoadOss(ossId) {
-  var url = baseUrl + '/system/oss/download/' + ossId
-  axios({
-    method: 'get',
-    url: url,
-    responseType: 'blob',
-    headers: { 'Authorization': 'Bearer ' + getToken() }
-  }).then(res => {
-    resolveBlob(res, mimeMap.oss)
-  })
-}
-
-export function downLoadExcel(url, params) {
-  // get璇锋眰鏄犲皠params鍙傛暟
-  if (params) {
-    let urlparams = url + '?';
-    for (const propName of Object.keys(params)) {
-      const value = params[propName];
-      var part = encodeURIComponent(propName) + "=";
-      if (value !== null && typeof(value) !== "undefined") {
-        if (typeof value === 'object') {
-          for (const key of Object.keys(value)) {
-            if (value[key] !== null && typeof (value[key]) !== 'undefined') {
-              let params = propName + '[' + key + ']';
-              let subPart = encodeURIComponent(params) + '=';
-              urlparams += subPart + encodeURIComponent(value[key]) + '&';
-            }
-          }
-        } else {
-          urlparams += part + encodeURIComponent(value) + "&";
-        }
-      }
-    }
-    urlparams = urlparams.slice(0, -1);
-    url = urlparams;
-  }
-  url = baseUrl + url
-  axios({
-    method: 'get',
-    url: url,
-    responseType: 'blob',
-    headers: { 'Authorization': 'Bearer ' + getToken() }
-  }).then(res => {
-    resolveBlob(res, mimeMap.xlsx)
-  })
-}
-
-/**
- * 瑙f瀽blob鍝嶅簲鍐呭骞朵笅杞�
- * @param {*} res blob鍝嶅簲鍐呭
- * @param {String} mimeType MIME绫诲瀷
- */
-export function resolveBlob(res, mimeType) {
-  const aLink = document.createElement('a')
-  var blob = new Blob([res.data], { type: mimeType })
-  // //浠巖esponse鐨刪eaders涓幏鍙杅ilename, 鍚庣response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 璁剧疆鐨勬枃浠跺悕;
-  var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
-  var contentDisposition = decodeURI(res.headers['content-disposition'])
-  var result = patt.exec(contentDisposition)
-  var fileName = result[1]
-  fileName = fileName.replace(/\"/g, '')
-  aLink.style.display = 'none'
-  aLink.href = URL.createObjectURL(blob)
-  aLink.setAttribute('download', decodeURI(fileName)) // 璁剧疆涓嬭浇鏂囦欢鍚嶇О
-  document.body.appendChild(aLink)
-  aLink.click()
-  URL.revokeObjectURL(aLink.href);//娓呴櫎寮曠敤
-  document.body.removeChild(aLink);
-}
diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js
index 10533e7..63bd379 100644
--- a/ruoyi-ui/src/utils/ruoyi.js
+++ b/ruoyi-ui/src/utils/ruoyi.js
@@ -3,8 +3,6 @@
  * Copyright (c) 2019 ruoyi
  */
 
-const baseURL = process.env.VUE_APP_BASE_API
-
 // 鏃ユ湡鏍煎紡鍖�
 export function parseTime(time, pattern) {
 	if (arguments.length === 0 || !time) {
diff --git a/ruoyi-ui/src/views/demo/demo/index.vue b/ruoyi-ui/src/views/demo/demo/index.vue
index 6f952ec..678ae21 100644
--- a/ruoyi-ui/src/views/demo/demo/index.vue
+++ b/ruoyi-ui/src/views/demo/demo/index.vue
@@ -358,7 +358,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/demo/demo/export', this.queryParams);
+      this.$download.excel('/demo/demo/export', this.queryParams);
     }
   }
 };
diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue
index 33d416e..a97477b 100644
--- a/ruoyi-ui/src/views/monitor/job/index.vue
+++ b/ruoyi-ui/src/views/monitor/job/index.vue
@@ -510,7 +510,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/monitor/job/export', this.queryParams);
+      this.$download.excel('/monitor/job/export', this.queryParams);
     }
   }
 };
diff --git a/ruoyi-ui/src/views/monitor/job/log.vue b/ruoyi-ui/src/views/monitor/job/log.vue
index 7f2e72e..fca1af4 100644
--- a/ruoyi-ui/src/views/monitor/job/log.vue
+++ b/ruoyi-ui/src/views/monitor/job/log.vue
@@ -293,7 +293,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/monitor/jobLog/export', this.queryParams);
+      this.$download.excel('/monitor/jobLog/export', this.queryParams);
     }
   }
 };
diff --git a/ruoyi-ui/src/views/monitor/logininfor/index.vue b/ruoyi-ui/src/views/monitor/logininfor/index.vue
index 2b83181..5b11301 100644
--- a/ruoyi-ui/src/views/monitor/logininfor/index.vue
+++ b/ruoyi-ui/src/views/monitor/logininfor/index.vue
@@ -216,7 +216,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/monitor/logininfor/export', this.queryParams);
+      this.$download.excel('/monitor/logininfor/export', this.queryParams);
     }
   }
 };
diff --git a/ruoyi-ui/src/views/monitor/operlog/index.vue b/ruoyi-ui/src/views/monitor/operlog/index.vue
index fafaf60..35fd2b8 100644
--- a/ruoyi-ui/src/views/monitor/operlog/index.vue
+++ b/ruoyi-ui/src/views/monitor/operlog/index.vue
@@ -303,7 +303,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/monitor/operlog/export', this.queryParams);
+      this.$download.excel('/monitor/operlog/export', this.queryParams);
     }
   }
 };
diff --git a/ruoyi-ui/src/views/system/config/index.vue b/ruoyi-ui/src/views/system/config/index.vue
index c4029c3..b037917 100644
--- a/ruoyi-ui/src/views/system/config/index.vue
+++ b/ruoyi-ui/src/views/system/config/index.vue
@@ -334,7 +334,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/system/config/export', this.queryParams);
+      this.$download.excel('/system/config/export', this.queryParams);
     },
     /** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */
     handleRefreshCache() {
diff --git a/ruoyi-ui/src/views/system/dict/data.vue b/ruoyi-ui/src/views/system/dict/data.vue
index 3f0b5e0..c7a9006 100644
--- a/ruoyi-ui/src/views/system/dict/data.vue
+++ b/ruoyi-ui/src/views/system/dict/data.vue
@@ -380,7 +380,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/system/dict/data/export', this.queryParams);
+      this.$download.excel('/system/dict/data/export', this.queryParams);
     }
   }
 };
diff --git a/ruoyi-ui/src/views/system/dict/index.vue b/ruoyi-ui/src/views/system/dict/index.vue
index c1c6649..6daa867 100644
--- a/ruoyi-ui/src/views/system/dict/index.vue
+++ b/ruoyi-ui/src/views/system/dict/index.vue
@@ -338,7 +338,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/system/dict/type/export', this.queryParams);
+      this.$download.excel('/system/dict/type/export', this.queryParams);
     },
     /** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */
     handleRefreshCache() {
diff --git a/ruoyi-ui/src/views/system/oss/index.vue b/ruoyi-ui/src/views/system/oss/index.vue
index 5b67191..fdfed16 100644
--- a/ruoyi-ui/src/views/system/oss/index.vue
+++ b/ruoyi-ui/src/views/system/oss/index.vue
@@ -188,7 +188,6 @@
 
 <script>
 import { listOss, delOss, changePreviewListResource } from "@/api/system/oss";
-import { downLoadOss } from "@/utils/download";
 
 export default {
   name: "Oss",
@@ -325,7 +324,7 @@
     },
     /** 涓嬭浇鎸夐挳鎿嶄綔 */
     handleDownload(row) {
-      downLoadOss(row.ossId)
+      this.$download.oss(row.ossId)
     },
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
diff --git a/ruoyi-ui/src/views/system/post/index.vue b/ruoyi-ui/src/views/system/post/index.vue
index 66fa209..8f823f3 100644
--- a/ruoyi-ui/src/views/system/post/index.vue
+++ b/ruoyi-ui/src/views/system/post/index.vue
@@ -305,7 +305,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/system/post/export', this.queryParams);
+      this.$download.excel('/system/post/export', this.queryParams);
     }
   }
 };
diff --git a/ruoyi-ui/src/views/system/role/index.vue b/ruoyi-ui/src/views/system/role/index.vue
index 2ad1cdb..4fcc398 100644
--- a/ruoyi-ui/src/views/system/role/index.vue
+++ b/ruoyi-ui/src/views/system/role/index.vue
@@ -613,7 +613,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/system/role/export', this.queryParams);
+      this.$download.excel('/system/role/export', this.queryParams);
     }
   }
 };
diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue
index aaa202d..4faa250 100644
--- a/ruoyi-ui/src/views/system/user/index.vue
+++ b/ruoyi-ui/src/views/system/user/index.vue
@@ -643,7 +643,7 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.downLoadExcel('/system/user/export', this.queryParams);
+      this.$download.excel('/system/user/export', this.queryParams);
     },
     /** 瀵煎叆鎸夐挳鎿嶄綔 */
     handleImport() {
@@ -652,7 +652,7 @@
     },
     /** 涓嬭浇妯℃澘鎿嶄綔 */
     importTemplate() {
-      this.downLoadExcel('/system/user/importTemplate');
+      this.$download.excel('/system/user/importTemplate');
     },
     // 鏂囦欢涓婁紶涓鐞�
     handleFileUploadProgress(event, file, fileList) {
diff --git a/ruoyi-ui/src/views/tool/build/index.vue b/ruoyi-ui/src/views/tool/build/index.vue
index 1f8b361..0a1d94c 100644
--- a/ruoyi-ui/src/views/tool/build/index.vue
+++ b/ruoyi-ui/src/views/tool/build/index.vue
@@ -137,23 +137,13 @@
 
 <script>
 import draggable from 'vuedraggable'
-import { saveAs } from 'file-saver'
 import beautifier from 'js-beautify'
 import ClipboardJS from 'clipboard'
 import render from '@/utils/generator/render'
 import RightPanel from './RightPanel'
-import {
-  inputComponents,
-  selectComponents,
-  layoutComponents,
-  formConf
-} from '@/utils/generator/config'
-import {
-  exportDefault, beautifierConf, isNumberStr, titleCase
-} from '@/utils/index'
-import {
-  makeUpHtml, vueTemplate, vueScript, cssStyle
-} from '@/utils/generator/html'
+import { inputComponents, selectComponents, layoutComponents, formConf } from '@/utils/generator/config'
+import { beautifierConf, titleCase } from '@/utils/index'
+import { makeUpHtml, vueTemplate, vueScript, cssStyle } from '@/utils/generator/html'
 import { makeUpJs } from '@/utils/generator/js'
 import { makeUpCss } from '@/utils/generator/css'
 import drawingDefalut from '@/utils/generator/drawingDefalut'
@@ -161,7 +151,6 @@
 import CodeTypeDialog from './CodeTypeDialog'
 import DraggableItem from './DraggableItem'
 
-const emptyActiveData = { style: {}, autosize: {} }
 let oldActiveId
 let tempActiveData
 
@@ -287,7 +276,7 @@
     execDownload(data) {
       const codeStr = this.generateCode()
       const blob = new Blob([codeStr], { type: 'text/plain;charset=utf-8' })
-      saveAs(blob, data.fileName)
+      this.$download.saveAs(blob, data.fileName)
     },
     execCopy(data) {
       document.getElementById('copyNode').click()
diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue
index 5f4e65b..646decf 100644
--- a/ruoyi-ui/src/views/tool/gen/index.vue
+++ b/ruoyi-ui/src/views/tool/gen/index.vue
@@ -180,7 +180,6 @@
 <script>
 import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen";
 import importTable from "./importTable";
-import { downLoadZip } from "@/utils/download";
 import hljs from "highlight.js/lib/highlight";
 import "highlight.js/styles/github-gist.css";
 hljs.registerLanguage("java", require("highlight.js/lib/languages/java"));
@@ -270,7 +269,7 @@
           this.$modal.msgSuccess("鎴愬姛鐢熸垚鍒拌嚜瀹氫箟璺緞锛�" + row.genPath);
         });
       } else {
-        downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi");
+        this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi");
       }
     },
     /** 鍚屾鏁版嵁搴撴搷浣� */

--
Gitblit v1.9.3