From 64add90edd42956b18d47bc3a8c72244598d6dda Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 17 十一月 2021 19:14:03 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev

---
 ruoyi-ui/src/views/system/dict/data.vue                                            |    9 +-
 ruoyi-ui/src/views/monitor/job/log.vue                                             |    9 +-
 ruoyi-ui/src/utils/ruoyi.js                                                        |   37 +++++++++
 ruoyi-ui/src/views/system/role/index.vue                                           |    9 +-
 ruoyi-generator/src/main/resources/vm/vue/index.vue.vm                             |    7 -
 ruoyi-ui/src/api/system/post.js                                                    |    9 --
 ruoyi-ui/src/views/system/user/index.vue                                           |   13 +-
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java |    2 
 ruoyi-ui/src/views/monitor/job/index.vue                                           |    7 -
 ruoyi-ui/src/views/monitor/operlog/index.vue                                       |    7 -
 ruoyi-ui/src/api/monitor/job.js                                                    |    9 --
 ruoyi-ui/src/views/system/config/index.vue                                         |    7 -
 ruoyi-ui/src/utils/request.js                                                      |   68 ++++++++++------
 ruoyi-ui/src/views/system/dict/index.vue                                           |    9 +-
 ruoyi-ui/package.json                                                              |    4 
 ruoyi-ui/src/main.js                                                               |    2 
 ruoyi-ui/src/plugins/download.js                                                   |   18 +---
 ruoyi-ui/src/views/monitor/logininfor/index.vue                                    |    7 -
 ruoyi-ui/src/views/system/post/index.vue                                           |    7 -
 19 files changed, 130 insertions(+), 110 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
index b732a0c..2f384bf 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
@@ -1,7 +1,6 @@
 package com.ruoyi.web.controller.system;
 
 import com.ruoyi.common.annotation.Log;
-import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -80,7 +79,6 @@
     @PreAuthorize("@ss.hasPermi('system:config:add')")
     @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.INSERT)
     @PostMapping
-    @RepeatSubmit
     public AjaxResult<Void> add(@Validated @RequestBody SysConfig config) {
         if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
             return AjaxResult.error("鏂板鍙傛暟'" + config.getConfigName() + "'澶辫触锛屽弬鏁伴敭鍚嶅凡瀛樺湪");
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 7e28c2e..7650170 100644
--- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
+++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
@@ -108,7 +108,6 @@
           plain
           icon="el-icon-download"
           size="mini"
-          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['${moduleName}:${businessName}:export']"
         >瀵煎嚭</el-button>
@@ -324,8 +323,6 @@
       buttonLoading: false,
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
 #if($table.sub)
@@ -573,7 +570,9 @@
 #end
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-        this.#[[$download]]#.excel('/${moduleName}/${businessName}/export', this.queryParams);
+      this.download('${moduleName}/${businessName}/export', {
+        ...this.queryParams
+      }, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
     }
   }
 };
diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json
index 89d591b..acb1fcb 100644
--- a/ruoyi-ui/package.json
+++ b/ruoyi-ui/package.json
@@ -37,9 +37,9 @@
   },
   "dependencies": {
     "@riophae/vue-treeselect": "0.4.0",
-    "axios": "0.21.0",
+    "axios": "0.24.0",
     "clipboard": "2.0.6",
-    "core-js": "3.8.1",
+    "core-js": "3.19.1",
     "echarts": "4.9.0",
     "element-ui": "2.15.6",
     "file-saver": "2.0.5",
diff --git a/ruoyi-ui/src/api/monitor/job.js b/ruoyi-ui/src/api/monitor/job.js
index 58c4343..3815569 100644
--- a/ruoyi-ui/src/api/monitor/job.js
+++ b/ruoyi-ui/src/api/monitor/job.js
@@ -43,15 +43,6 @@
   })
 }
 
-// 瀵煎嚭瀹氭椂浠诲姟璋冨害
-export function exportJob(query) {
-  return request({
-    url: '/monitor/job/export',
-    method: 'get',
-    params: query
-  })
-}
-
 // 浠诲姟鐘舵�佷慨鏀�
 export function changeJobStatus(jobId, status) {
   const data = {
diff --git a/ruoyi-ui/src/api/system/post.js b/ruoyi-ui/src/api/system/post.js
index 434cd35..1a8e9ca 100644
--- a/ruoyi-ui/src/api/system/post.js
+++ b/ruoyi-ui/src/api/system/post.js
@@ -42,12 +42,3 @@
     method: 'delete'
   })
 }
-
-// 瀵煎嚭宀椾綅
-export function exportPost(query) {
-  return request({
-    url: '/system/post/export',
-    method: 'get',
-    params: query
-  })
-}
\ No newline at end of file
diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js
index c6306a6..76e33d5 100644
--- a/ruoyi-ui/src/main.js
+++ b/ruoyi-ui/src/main.js
@@ -12,6 +12,7 @@
 import router from './router'
 import directive from './directive' //directive
 import plugins from './plugins' // plugins
+import { download } from '@/utils/request'
 
 import './assets/icons' // icon
 import './permission' // permission control
@@ -43,6 +44,7 @@
 Vue.prototype.addDateRange = addDateRange
 Vue.prototype.selectDictLabel = selectDictLabel
 Vue.prototype.selectDictLabels = selectDictLabels
+Vue.prototype.download = download
 Vue.prototype.handleTree = handleTree
 
 // 鍏ㄥ眬缁勪欢鎸傝浇
diff --git a/ruoyi-ui/src/plugins/download.js b/ruoyi-ui/src/plugins/download.js
index ec7bdd4..94249ee 100644
--- a/ruoyi-ui/src/plugins/download.js
+++ b/ruoyi-ui/src/plugins/download.js
@@ -1,7 +1,8 @@
-import { saveAs } from 'file-saver'
 import axios from 'axios'
-import { getToken } from '@/utils/auth'
 import { Message } from 'element-ui'
+import { saveAs } from 'file-saver'
+import { getToken } from '@/utils/auth'
+import { blobValidate } from "@/utils/ruoyi";
 
 const baseURL = process.env.VUE_APP_BASE_API
 
@@ -71,7 +72,7 @@
       responseType: 'blob',
       headers: { 'Authorization': 'Bearer ' + getToken() }
     }).then(async (res) => {
-      const isLogin = await this.blobValidate(res.data);
+      const isLogin = await blobValidate(res.data);
       if (isLogin) {
         const blob = new Blob([res.data], { type: 'application/zip' })
         this.saveAs(blob, name)
@@ -82,15 +83,6 @@
   },
   saveAs(text, name, opts) {
     saveAs(text, name, opts);
-  },
-  async blobValidate(data) {
-    try {
-      const text = await data.text();
-      JSON.parse(text);
-      return false;
-    } catch (error) {
-      return true;
-    }
-  },
+  }
 }
 
diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js
index 31944e2..deff980 100644
--- a/ruoyi-ui/src/utils/request.js
+++ b/ruoyi-ui/src/utils/request.js
@@ -1,8 +1,12 @@
 import axios from 'axios'
-import { Notification, MessageBox, Message } from 'element-ui'
+import { Notification, MessageBox, Message, Loading } from 'element-ui'
 import store from '@/store'
 import { getToken } from '@/utils/auth'
 import errorCode from '@/utils/errorCode'
+import { tansParams, blobValidate } from "@/utils/ruoyi";
+import { saveAs } from 'file-saver'
+
+let downloadLoadingInstance;
 
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 // 瀵瑰簲鍥介檯鍖栬祫婧愭枃浠跺悗缂�
@@ -14,6 +18,7 @@
   // 瓒呮椂
   timeout: 10000
 })
+
 // request鎷︽埅鍣�
 service.interceptors.request.use(config => {
   // 鏄惁闇�瑕佽缃� token
@@ -23,24 +28,7 @@
   }
   // get璇锋眰鏄犲皠params鍙傛暟
   if (config.method === 'get' && config.params) {
-    let url = config.url + '?';
-    for (const propName of Object.keys(config.params)) {
-      const value = config.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) + '=';
-              url += subPart + encodeURIComponent(value[key]) + '&';
-            }
-          }
-        } else {
-          url += part + encodeURIComponent(value) + "&";
-        }
-      }
-    }
+    let url = config.url + '?' + tansParams(config.params);
     url = url.slice(0, -1);
     config.params = {};
     config.url = url;
@@ -57,17 +45,24 @@
     const code = res.data.code || 200;
     // 鑾峰彇閿欒淇℃伅
     const msg = errorCode[code] || res.data.msg || errorCode['default']
+    // 浜岃繘鍒舵暟鎹垯鐩存帴杩斿洖
+    if(res.request.responseType ===  'blob' || res.request.responseType ===  'arraybuffer'){
+      return res.data
+    }
     if (code === 401) {
-      MessageBox.confirm('鐧诲綍鐘舵�佸凡杩囨湡锛屾偍鍙互缁х画鐣欏湪璇ラ〉闈紝鎴栬�呴噸鏂扮櫥褰�', '绯荤粺鎻愮ず', {
+      let doms = document.getElementsByClassName('el-message-box')[0]
+      if(doms === undefined){
+        MessageBox.confirm('鐧诲綍鐘舵�佸凡杩囨湡锛屾偍鍙互缁х画鐣欏湪璇ラ〉闈紝鎴栬�呴噸鏂扮櫥褰�', '绯荤粺鎻愮ず', {
           confirmButtonText: '閲嶆柊鐧诲綍',
           cancelButtonText: '鍙栨秷',
           type: 'warning'
         }
-      ).then(() => {
-        store.dispatch('LogOut').then(() => {
-          location.href = process.env.VUE_APP_CONTEXT_PATH + "index";
-        })
-      }).catch(() => {});
+        ).then(() => {
+          store.dispatch('LogOut').then(() => {
+            location.href = process.env.VUE_APP_CONTEXT_PATH + "index";
+          })
+        }).catch(() => {});
+      }
       return Promise.reject('鏃犳晥鐨勪細璇濓紝鎴栬�呬細璇濆凡杩囨湡锛岃閲嶆柊鐧诲綍銆�')
     } else if (code === 500) {
       Message({
@@ -105,4 +100,27 @@
   }
 )
 
+// 閫氱敤涓嬭浇鏂规硶
+export function download(url, params, filename) {
+  downloadLoadingInstance = Loading.service({ text: "姝e湪涓嬭浇鏁版嵁锛岃绋嶅��", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
+  return service.post(url, params, {
+    transformRequest: [(params) => { return tansParams(params) }],
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+    responseType: 'blob'
+  }).then(async (data) => {
+    const isLogin = await blobValidate(data);
+    if (isLogin) {
+      const blob = new Blob([data])
+      saveAs(blob, filename)
+    } else {
+      Message.error('鏃犳晥鐨勪細璇濓紝鎴栬�呬細璇濆凡杩囨湡锛岃閲嶆柊鐧诲綍銆�');
+    }
+    downloadLoadingInstance.close();
+  }).catch((r) => {
+    console.error(r)
+    Message.error('涓嬭浇鏂囦欢鍑虹幇閿欒锛岃鑱旂郴绠$悊鍛橈紒')
+    downloadLoadingInstance.close();
+  })
+}
+
 export default service
diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js
index 440bf4c..4cc5e24 100644
--- a/ruoyi-ui/src/utils/ruoyi.js
+++ b/ruoyi-ui/src/utils/ruoyi.js
@@ -181,3 +181,40 @@
 	}
 	return tree;
 }
+
+/**
+* 鍙傛暟澶勭悊
+* @param {*} params  鍙傛暟
+*/
+export function tansParams(params) {
+	let result = ''
+	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 + ']';
+						var subPart = encodeURIComponent(params) + "=";
+						result += subPart + encodeURIComponent(value[key]) + "&";
+					}
+				}
+			} else {
+				result += part + encodeURIComponent(value) + "&";
+			}
+		}
+	}
+	return result
+}
+
+// 楠岃瘉鏄惁涓篵lob鏍煎紡
+export async function blobValidate(data) {
+    try {
+      const text = await data.text();
+      JSON.parse(text);
+      return false;
+    } catch (error) {
+      return true;
+    }
+}
diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue
index a97477b..b8284ab 100644
--- a/ruoyi-ui/src/views/monitor/job/index.vue
+++ b/ruoyi-ui/src/views/monitor/job/index.vue
@@ -75,7 +75,6 @@
           plain
           icon="el-icon-download"
           size="mini"
-          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['monitor:job:export']"
         >瀵煎嚭</el-button>
@@ -306,8 +305,6 @@
     return {
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -510,7 +507,9 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.$download.excel('/monitor/job/export', this.queryParams);
+      this.download('monitor/job/export', {
+        ...this.queryParams
+      }, `job_${new Date().getTime()}.xlsx`)
     }
   }
 };
diff --git a/ruoyi-ui/src/views/monitor/job/log.vue b/ruoyi-ui/src/views/monitor/job/log.vue
index fca1af4..35b7788 100644
--- a/ruoyi-ui/src/views/monitor/job/log.vue
+++ b/ruoyi-ui/src/views/monitor/job/log.vue
@@ -89,7 +89,6 @@
           plain
           icon="el-icon-download"
           size="mini"
-          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['monitor:job:export']"
         >瀵煎嚭</el-button>
@@ -185,7 +184,7 @@
 </template>
 
 <script>
-import { getJob } from "@/api/monitor/job";
+import { getJob} from "@/api/monitor/job";
 import { listJobLog, delJobLog, cleanJobLog } from "@/api/monitor/jobLog";
 
 export default {
@@ -195,8 +194,6 @@
     return {
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲涓鐢�
@@ -293,7 +290,9 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.$download.excel('/monitor/jobLog/export', this.queryParams);
+      this.download('/monitor/jobLog/export', {
+        ...this.queryParams
+      }, `log_${new Date().getTime()}.xlsx`)
     }
   }
 };
diff --git a/ruoyi-ui/src/views/monitor/logininfor/index.vue b/ruoyi-ui/src/views/monitor/logininfor/index.vue
index 5b11301..0f4ecbb 100644
--- a/ruoyi-ui/src/views/monitor/logininfor/index.vue
+++ b/ruoyi-ui/src/views/monitor/logininfor/index.vue
@@ -83,7 +83,6 @@
           plain
           icon="el-icon-download"
           size="mini"
-          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['monitor:logininfor:export']"
         >瀵煎嚭</el-button>
@@ -132,8 +131,6 @@
     return {
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲涓鐢�
@@ -216,7 +213,9 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.$download.excel('/monitor/logininfor/export', this.queryParams);
+      this.download('monitor/logininfor/export', {
+        ...this.queryParams
+      }, `logininfor_${new Date().getTime()}.xlsx`)
     }
   }
 };
diff --git a/ruoyi-ui/src/views/monitor/operlog/index.vue b/ruoyi-ui/src/views/monitor/operlog/index.vue
index 35fd2b8..28f705b 100644
--- a/ruoyi-ui/src/views/monitor/operlog/index.vue
+++ b/ruoyi-ui/src/views/monitor/operlog/index.vue
@@ -99,7 +99,6 @@
           plain
           icon="el-icon-download"
           size="mini"
-          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['monitor:operlog:export']"
         >瀵煎嚭</el-button>
@@ -205,8 +204,6 @@
     return {
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲涓鐢�
@@ -303,7 +300,9 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.$download.excel('/monitor/operlog/export', this.queryParams);
+      this.download('monitor/operlog/export', {
+        ...this.queryParams
+      }, `operlog_${new Date().getTime()}.xlsx`)
     }
   }
 };
diff --git a/ruoyi-ui/src/views/system/config/index.vue b/ruoyi-ui/src/views/system/config/index.vue
index b037917..9fde370 100644
--- a/ruoyi-ui/src/views/system/config/index.vue
+++ b/ruoyi-ui/src/views/system/config/index.vue
@@ -88,7 +88,6 @@
           plain
           icon="el-icon-download"
           size="mini"
-          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['system:config:export']"
         >瀵煎嚭</el-button>
@@ -194,8 +193,6 @@
     return {
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -334,7 +331,9 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.$download.excel('/system/config/export', this.queryParams);
+      this.download('system/config/export', {
+        ...this.queryParams
+      }, `config_${new Date().getTime()}.xlsx`)
     },
     /** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */
     handleRefreshCache() {
diff --git a/ruoyi-ui/src/views/system/dict/data.vue b/ruoyi-ui/src/views/system/dict/data.vue
index c7a9006..bb77919 100644
--- a/ruoyi-ui/src/views/system/dict/data.vue
+++ b/ruoyi-ui/src/views/system/dict/data.vue
@@ -75,7 +75,6 @@
           plain
           icon="el-icon-download"
           size="mini"
-          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['system:dict:export']"
         >瀵煎嚭</el-button>
@@ -193,8 +192,6 @@
     return {
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -380,8 +377,10 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.$download.excel('/system/dict/data/export', this.queryParams);
+      this.download('system/dict/data/export', {
+        ...this.queryParams
+      }, `data_${new Date().getTime()}.xlsx`)
     }
   }
 };
-</script>
\ No newline at end of file
+</script>
diff --git a/ruoyi-ui/src/views/system/dict/index.vue b/ruoyi-ui/src/views/system/dict/index.vue
index 6daa867..92b78c9 100644
--- a/ruoyi-ui/src/views/system/dict/index.vue
+++ b/ruoyi-ui/src/views/system/dict/index.vue
@@ -94,7 +94,6 @@
           plain
           icon="el-icon-download"
           size="mini"
-          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['system:dict:export']"
         >瀵煎嚭</el-button>
@@ -202,8 +201,6 @@
     return {
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -338,7 +335,9 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.$download.excel('/system/dict/type/export', this.queryParams);
+      this.download('system/dict/type/export', {
+        ...this.queryParams
+      }, `type_${new Date().getTime()}.xlsx`)
     },
     /** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */
     handleRefreshCache() {
@@ -348,4 +347,4 @@
     }
   }
 };
-</script>
\ No newline at end of file
+</script>
diff --git a/ruoyi-ui/src/views/system/post/index.vue b/ruoyi-ui/src/views/system/post/index.vue
index 8f823f3..02698da 100644
--- a/ruoyi-ui/src/views/system/post/index.vue
+++ b/ruoyi-ui/src/views/system/post/index.vue
@@ -74,7 +74,6 @@
           plain
           icon="el-icon-download"
           size="mini"
-          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['system:post:export']"
         >瀵煎嚭</el-button>
@@ -169,8 +168,6 @@
     return {
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -305,7 +302,9 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.$download.excel('/system/post/export', this.queryParams);
+      this.download('system/post/export', {
+        ...this.queryParams
+      }, `post_${new Date().getTime()}.xlsx`)
     }
   }
 };
diff --git a/ruoyi-ui/src/views/system/role/index.vue b/ruoyi-ui/src/views/system/role/index.vue
index 9ca11c0..a2a4120 100644
--- a/ruoyi-ui/src/views/system/role/index.vue
+++ b/ruoyi-ui/src/views/system/role/index.vue
@@ -94,7 +94,6 @@
           plain
           icon="el-icon-download"
           size="mini"
-          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['system:role:export']"
         >瀵煎嚭</el-button>
@@ -270,8 +269,6 @@
     return {
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -613,8 +610,10 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.$download.excel('/system/role/export', this.queryParams);
+      this.download('system/role/export', {
+        ...this.queryParams
+      }, `role_${new Date().getTime()}.xlsx`)
     }
   }
 };
-</script>
\ No newline at end of file
+</script>
diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue
index 4faa250..4d86a14 100644
--- a/ruoyi-ui/src/views/system/user/index.vue
+++ b/ruoyi-ui/src/views/system/user/index.vue
@@ -131,7 +131,6 @@
               plain
               icon="el-icon-download"
               size="mini"
-              :loading="exportLoading"
               @click="handleExport"
               v-hasPermi="['system:user:export']"
             >瀵煎嚭</el-button>
@@ -360,8 +359,6 @@
     return {
       // 閬僵灞�
       loading: true,
-      // 瀵煎嚭閬僵灞�
-      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -643,7 +640,9 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.$download.excel('/system/user/export', this.queryParams);
+      this.download('system/user/export', {
+        ...this.queryParams
+      }, `user_${new Date().getTime()}.xlsx`)
     },
     /** 瀵煎叆鎸夐挳鎿嶄綔 */
     handleImport() {
@@ -652,7 +651,9 @@
     },
     /** 涓嬭浇妯℃澘鎿嶄綔 */
     importTemplate() {
-      this.$download.excel('/system/user/importTemplate');
+      this.download('system/user/importTemplate', {
+        ...this.queryParams
+      }, `user_template_${new Date().getTime()}.xlsx`)
     },
     // 鏂囦欢涓婁紶涓鐞�
     handleFileUploadProgress(event, file, fileList) {
@@ -672,4 +673,4 @@
     }
   }
 };
-</script>
\ No newline at end of file
+</script>

--
Gitblit v1.9.3