RuoYi лет назад: 4
Родитель
Сommit
173c0e384f
16 измененных файлов с 31 добавлено и 46 удалено
  1. 8 10
      ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java
  2. 1 1
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/controller.java.vm
  3. 1 1
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
  4. 1 2
      ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/controller/SysJobController.java
  5. 1 2
      ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/controller/SysJobLogController.java
  6. 1 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysConfigController.java
  7. 1 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java
  8. 1 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictTypeController.java
  9. 1 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysLogininforController.java
  10. 1 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysOperlogController.java
  11. 1 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysPostController.java
  12. 1 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java
  13. 1 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
  14. 10 7
      ruoyi-ui/src/utils/request.js
  15. 0 7
      ruoyi-ui/src/utils/ruoyi.js
  16. 1 1
      ruoyi-ui/src/views/system/user/index.vue

+ 8 - 10
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java

@@ -2,7 +2,6 @@ package com.ruoyi.common.core.utils.poi;
2
 
2
 
3
 import java.io.IOException;
3
 import java.io.IOException;
4
 import java.io.InputStream;
4
 import java.io.InputStream;
5
-import java.io.OutputStream;
6
 import java.lang.reflect.Field;
5
 import java.lang.reflect.Field;
7
 import java.lang.reflect.Method;
6
 import java.lang.reflect.Method;
8
 import java.math.BigDecimal;
7
 import java.math.BigDecimal;
@@ -357,7 +356,7 @@ public class ExcelUtil<T>
357
      * @return 结果
356
      * @return 结果
358
      * @throws IOException
357
      * @throws IOException
359
      */
358
      */
360
-    public void exportExcel(HttpServletResponse response, List<T> list, String sheetName)throws IOException
359
+    public void exportExcel(HttpServletResponse response, List<T> list, String sheetName)
361
     {
360
     {
362
         exportExcel(response, list, sheetName, StringUtils.EMPTY);
361
         exportExcel(response, list, sheetName, StringUtils.EMPTY);
363
     }
362
     }
@@ -372,12 +371,12 @@ public class ExcelUtil<T>
372
      * @return 结果
371
      * @return 结果
373
      * @throws IOException
372
      * @throws IOException
374
      */
373
      */
375
-    public void exportExcel(HttpServletResponse response, List<T> list, String sheetName, String title) throws IOException
374
+    public void exportExcel(HttpServletResponse response, List<T> list, String sheetName, String title)
376
     {
375
     {
377
         response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
376
         response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
378
         response.setCharacterEncoding("utf-8");
377
         response.setCharacterEncoding("utf-8");
379
         this.init(list, sheetName, title, Type.EXPORT);
378
         this.init(list, sheetName, title, Type.EXPORT);
380
-        exportExcel(response.getOutputStream());
379
+        exportExcel(response);
381
     }
380
     }
382
 
381
 
383
     /**
382
     /**
@@ -392,7 +391,7 @@ public class ExcelUtil<T>
392
      * @param sheetName 工作表的名称
391
      * @param sheetName 工作表的名称
393
      * @return 结果
392
      * @return 结果
394
      */
393
      */
395
-    public void importTemplateExcel(HttpServletResponse response, String sheetName) throws IOException
394
+    public void importTemplateExcel(HttpServletResponse response, String sheetName)
396
     {
395
     {
397
         importTemplateExcel(response, sheetName, StringUtils.EMPTY);
396
         importTemplateExcel(response, sheetName, StringUtils.EMPTY);
398
     }
397
     }
@@ -404,12 +403,12 @@ public class ExcelUtil<T>
404
      * @param title 标题
403
      * @param title 标题
405
      * @return 结果
404
      * @return 结果
406
      */
405
      */
407
-    public void importTemplateExcel(HttpServletResponse response, String sheetName, String title) throws IOException
406
+    public void importTemplateExcel(HttpServletResponse response, String sheetName, String title)
408
     {
407
     {
409
         response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
408
         response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
410
         response.setCharacterEncoding("utf-8");
409
         response.setCharacterEncoding("utf-8");
411
         this.init(null, sheetName, title, Type.IMPORT);
410
         this.init(null, sheetName, title, Type.IMPORT);
412
-        exportExcel(response.getOutputStream());
411
+        exportExcel(response);
413
     }
412
     }
414
 
413
 
415
     /**
414
     /**
@@ -417,12 +416,12 @@ public class ExcelUtil<T>
417
      * 
416
      * 
418
      * @return 结果
417
      * @return 结果
419
      */
418
      */
420
-    public void exportExcel(OutputStream out)
419
+    public void exportExcel(HttpServletResponse response)
421
     {
420
     {
422
         try
421
         try
423
         {
422
         {
424
             writeSheet();
423
             writeSheet();
425
-            wb.write(out);
424
+            wb.write(response.getOutputStream());
426
         }
425
         }
427
         catch (Exception e)
426
         catch (Exception e)
428
         {
427
         {
@@ -431,7 +430,6 @@ public class ExcelUtil<T>
431
         finally
430
         finally
432
         {
431
         {
433
             IOUtils.closeQuietly(wb);
432
             IOUtils.closeQuietly(wb);
434
-            IOUtils.closeQuietly(out);
435
         }
433
         }
436
     }
434
     }
437
 
435
 

+ 1 - 1
ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/controller.java.vm

@@ -64,7 +64,7 @@ public class ${ClassName}Controller extends BaseController
64
     @RequiresPermissions("${permissionPrefix}:export")
64
     @RequiresPermissions("${permissionPrefix}:export")
65
     @Log(title = "${functionName}", businessType = BusinessType.EXPORT)
65
     @Log(title = "${functionName}", businessType = BusinessType.EXPORT)
66
     @PostMapping("/export")
66
     @PostMapping("/export")
67
-    public void export(HttpServletResponse response, ${ClassName} ${className}) throws IOException
67
+    public void export(HttpServletResponse response, ${ClassName} ${className})
68
     {
68
     {
69
         List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
69
         List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
70
         ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class);
70
         ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class);

+ 1 - 1
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm

@@ -561,7 +561,7 @@ export default {
561
     handleExport() {
561
     handleExport() {
562
       this.download('${moduleName}/${businessName}/export', {
562
       this.download('${moduleName}/${businessName}/export', {
563
         ...this.queryParams
563
         ...this.queryParams
564
-      }, `${moduleName}_${businessName}.xlsx`)
564
+      }, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
565
     }
565
     }
566
   }
566
   }
567
 };
567
 };

+ 1 - 2
ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/controller/SysJobController.java

@@ -1,6 +1,5 @@
1
 package com.ruoyi.job.controller;
1
 package com.ruoyi.job.controller;
2
 
2
 
3
-import java.io.IOException;
4
 import java.util.List;
3
 import java.util.List;
5
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
6
 import org.quartz.SchedulerException;
5
 import org.quartz.SchedulerException;
@@ -58,7 +57,7 @@ public class SysJobController extends BaseController
58
     @RequiresPermissions("monitor:job:export")
57
     @RequiresPermissions("monitor:job:export")
59
     @Log(title = "定时任务", businessType = BusinessType.EXPORT)
58
     @Log(title = "定时任务", businessType = BusinessType.EXPORT)
60
     @PostMapping("/export")
59
     @PostMapping("/export")
61
-    public void export(HttpServletResponse response, SysJob sysJob) throws IOException
60
+    public void export(HttpServletResponse response, SysJob sysJob)
62
     {
61
     {
63
         List<SysJob> list = jobService.selectJobList(sysJob);
62
         List<SysJob> list = jobService.selectJobList(sysJob);
64
         ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);
63
         ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);

+ 1 - 2
ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/controller/SysJobLogController.java

@@ -1,6 +1,5 @@
1
 package com.ruoyi.job.controller;
1
 package com.ruoyi.job.controller;
2
 
2
 
3
-import java.io.IOException;
4
 import java.util.List;
3
 import java.util.List;
5
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
6
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,7 +49,7 @@ public class SysJobLogController extends BaseController
50
     @RequiresPermissions("monitor:job:export")
49
     @RequiresPermissions("monitor:job:export")
51
     @Log(title = "任务调度日志", businessType = BusinessType.EXPORT)
50
     @Log(title = "任务调度日志", businessType = BusinessType.EXPORT)
52
     @PostMapping("/export")
51
     @PostMapping("/export")
53
-    public void export(HttpServletResponse response, SysJobLog sysJobLog) throws IOException
52
+    public void export(HttpServletResponse response, SysJobLog sysJobLog)
54
     {
53
     {
55
         List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
54
         List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
56
         ExcelUtil<SysJobLog> util = new ExcelUtil<SysJobLog>(SysJobLog.class);
55
         ExcelUtil<SysJobLog> util = new ExcelUtil<SysJobLog>(SysJobLog.class);

+ 1 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysConfigController.java

@@ -1,6 +1,5 @@
1
 package com.ruoyi.system.controller;
1
 package com.ruoyi.system.controller;
2
 
2
 
3
-import java.io.IOException;
4
 import java.util.List;
3
 import java.util.List;
5
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
6
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
@@ -52,7 +51,7 @@ public class SysConfigController extends BaseController
52
     @Log(title = "参数管理", businessType = BusinessType.EXPORT)
51
     @Log(title = "参数管理", businessType = BusinessType.EXPORT)
53
     @RequiresPermissions("system:config:export")
52
     @RequiresPermissions("system:config:export")
54
     @PostMapping("/export")
53
     @PostMapping("/export")
55
-    public void export(HttpServletResponse response, SysConfig config) throws IOException
54
+    public void export(HttpServletResponse response, SysConfig config)
56
     {
55
     {
57
         List<SysConfig> list = configService.selectConfigList(config);
56
         List<SysConfig> list = configService.selectConfigList(config);
58
         ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
57
         ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);

+ 1 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java

@@ -1,6 +1,5 @@
1
 package com.ruoyi.system.controller;
1
 package com.ruoyi.system.controller;
2
 
2
 
3
-import java.io.IOException;
4
 import java.util.ArrayList;
3
 import java.util.ArrayList;
5
 import java.util.List;
4
 import java.util.List;
6
 import javax.servlet.http.HttpServletResponse;
5
 import javax.servlet.http.HttpServletResponse;
@@ -54,7 +53,7 @@ public class SysDictDataController extends BaseController
54
     @Log(title = "字典数据", businessType = BusinessType.EXPORT)
53
     @Log(title = "字典数据", businessType = BusinessType.EXPORT)
55
     @RequiresPermissions("system:dict:export")
54
     @RequiresPermissions("system:dict:export")
56
     @PostMapping("/export")
55
     @PostMapping("/export")
57
-    public void export(HttpServletResponse response, SysDictData dictData) throws IOException
56
+    public void export(HttpServletResponse response, SysDictData dictData)
58
     {
57
     {
59
         List<SysDictData> list = dictDataService.selectDictDataList(dictData);
58
         List<SysDictData> list = dictDataService.selectDictDataList(dictData);
60
         ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
59
         ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);

+ 1 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictTypeController.java

@@ -1,6 +1,5 @@
1
 package com.ruoyi.system.controller;
1
 package com.ruoyi.system.controller;
2
 
2
 
3
-import java.io.IOException;
4
 import java.util.List;
3
 import java.util.List;
5
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
6
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,7 +48,7 @@ public class SysDictTypeController extends BaseController
49
     @Log(title = "字典类型", businessType = BusinessType.EXPORT)
48
     @Log(title = "字典类型", businessType = BusinessType.EXPORT)
50
     @RequiresPermissions("system:dict:export")
49
     @RequiresPermissions("system:dict:export")
51
     @PostMapping("/export")
50
     @PostMapping("/export")
52
-    public void export(HttpServletResponse response, SysDictType dictType) throws IOException
51
+    public void export(HttpServletResponse response, SysDictType dictType)
53
     {
52
     {
54
         List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
53
         List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
55
         ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
54
         ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);

+ 1 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysLogininforController.java

@@ -1,6 +1,5 @@
1
 package com.ruoyi.system.controller;
1
 package com.ruoyi.system.controller;
2
 
2
 
3
-import java.io.IOException;
4
 import java.util.List;
3
 import java.util.List;
5
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
6
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,7 +45,7 @@ public class SysLogininforController extends BaseController
46
     @Log(title = "登录日志", businessType = BusinessType.EXPORT)
45
     @Log(title = "登录日志", businessType = BusinessType.EXPORT)
47
     @RequiresPermissions("system:logininfor:export")
46
     @RequiresPermissions("system:logininfor:export")
48
     @PostMapping("/export")
47
     @PostMapping("/export")
49
-    public void export(HttpServletResponse response, SysLogininfor logininfor) throws IOException
48
+    public void export(HttpServletResponse response, SysLogininfor logininfor)
50
     {
49
     {
51
         List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
50
         List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
52
         ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
51
         ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);

+ 1 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysOperlogController.java

@@ -1,6 +1,5 @@
1
 package com.ruoyi.system.controller;
1
 package com.ruoyi.system.controller;
2
 
2
 
3
-import java.io.IOException;
4
 import java.util.List;
3
 import java.util.List;
5
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
6
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,7 +45,7 @@ public class SysOperlogController extends BaseController
46
     @Log(title = "操作日志", businessType = BusinessType.EXPORT)
45
     @Log(title = "操作日志", businessType = BusinessType.EXPORT)
47
     @RequiresPermissions("system:operlog:export")
46
     @RequiresPermissions("system:operlog:export")
48
     @PostMapping("/export")
47
     @PostMapping("/export")
49
-    public void export(HttpServletResponse response, SysOperLog operLog) throws IOException
48
+    public void export(HttpServletResponse response, SysOperLog operLog)
50
     {
49
     {
51
         List<SysOperLog> list = operLogService.selectOperLogList(operLog);
50
         List<SysOperLog> list = operLogService.selectOperLogList(operLog);
52
         ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
51
         ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);

+ 1 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysPostController.java

@@ -1,6 +1,5 @@
1
 package com.ruoyi.system.controller;
1
 package com.ruoyi.system.controller;
2
 
2
 
3
-import java.io.IOException;
4
 import java.util.List;
3
 import java.util.List;
5
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
6
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
@@ -52,7 +51,7 @@ public class SysPostController extends BaseController
52
     @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
51
     @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
53
     @RequiresPermissions("system:post:export")
52
     @RequiresPermissions("system:post:export")
54
     @PostMapping("/export")
53
     @PostMapping("/export")
55
-    public void export(HttpServletResponse response, SysPost post) throws IOException
54
+    public void export(HttpServletResponse response, SysPost post)
56
     {
55
     {
57
         List<SysPost> list = postService.selectPostList(post);
56
         List<SysPost> list = postService.selectPostList(post);
58
         ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
57
         ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);

+ 1 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java

@@ -1,6 +1,5 @@
1
 package com.ruoyi.system.controller;
1
 package com.ruoyi.system.controller;
2
 
2
 
3
-import java.io.IOException;
4
 import java.util.List;
3
 import java.util.List;
5
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
6
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
@@ -55,7 +54,7 @@ public class SysRoleController extends BaseController
55
     @Log(title = "角色管理", businessType = BusinessType.EXPORT)
54
     @Log(title = "角色管理", businessType = BusinessType.EXPORT)
56
     @RequiresPermissions("system:role:export")
55
     @RequiresPermissions("system:role:export")
57
     @PostMapping("/export")
56
     @PostMapping("/export")
58
-    public void export(HttpServletResponse response, SysRole role) throws IOException
57
+    public void export(HttpServletResponse response, SysRole role)
59
     {
58
     {
60
         List<SysRole> list = roleService.selectRoleList(role);
59
         List<SysRole> list = roleService.selectRoleList(role);
61
         ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
60
         ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java

@@ -77,7 +77,7 @@ public class SysUserController extends BaseController
77
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
77
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
78
     @RequiresPermissions("system:user:export")
78
     @RequiresPermissions("system:user:export")
79
     @PostMapping("/export")
79
     @PostMapping("/export")
80
-    public void export(HttpServletResponse response, SysUser user) throws IOException
80
+    public void export(HttpServletResponse response, SysUser user)
81
     {
81
     {
82
         List<SysUser> list = userService.selectUserList(user);
82
         List<SysUser> list = userService.selectUserList(user);
83
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
83
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);

+ 10 - 7
ruoyi-ui/src/utils/request.js

@@ -8,7 +8,7 @@ import { saveAs } from 'file-saver'
8
 
8
 
9
 let downloadLoadingInstance;
9
 let downloadLoadingInstance;
10
 
10
 
11
-axios.defaults.headers['Conntent-Type'] = 'application/json;charset=utf-8'
11
+axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
12
 // 创建axios实例
12
 // 创建axios实例
13
 const service = axios.create({
13
 const service = axios.create({
14
   // axios中请求配置有baseURL选项,表示请求URL公共部分
14
   // axios中请求配置有baseURL选项,表示请求URL公共部分
@@ -48,16 +48,19 @@ service.interceptors.response.use(res => {
48
       return res.data
48
       return res.data
49
     }
49
     }
50
     if (code === 401) {
50
     if (code === 401) {
51
-      MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
51
+      let doms = document.getElementsByClassName('el-message-box')[0]
52
+      if(doms === undefined){
53
+        MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
52
           confirmButtonText: '重新登录',
54
           confirmButtonText: '重新登录',
53
           cancelButtonText: '取消',
55
           cancelButtonText: '取消',
54
           type: 'warning'
56
           type: 'warning'
55
         }
57
         }
56
-      ).then(() => {
57
-        store.dispatch('LogOut').then(() => {
58
-          location.href = '/index';
59
-        })
60
-      }).catch(() => {});
58
+        ).then(() => {
59
+          store.dispatch('LogOut').then(() => {
60
+            location.href = '/index';
61
+          })
62
+        }).catch(() => {});
63
+      }
61
       return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
64
       return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
62
     } else if (code === 500) {
65
     } else if (code === 500) {
63
       Message({
66
       Message({

+ 0 - 7
ruoyi-ui/src/utils/ruoyi.js

@@ -3,8 +3,6 @@
3
  * Copyright (c) 2019 ruoyi
3
  * Copyright (c) 2019 ruoyi
4
  */
4
  */
5
 
5
 
6
-const baseURL = process.env.VUE_APP_BASE_API
7
-
8
 // 日期格式化
6
 // 日期格式化
9
 export function parseTime(time, pattern) {
7
 export function parseTime(time, pattern) {
10
 	if (arguments.length === 0 || !time) {
8
 	if (arguments.length === 0 || !time) {
@@ -95,11 +93,6 @@ export function selectDictLabels(datas, value, separator) {
95
 	return actions.join('').substring(0, actions.join('').length - 1);
93
 	return actions.join('').substring(0, actions.join('').length - 1);
96
 }
94
 }
97
 
95
 
98
-// 通用下载方法
99
-export function download(fileName) {
100
-	window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
101
-}
102
-
103
 // 字符串格式化(%s )
96
 // 字符串格式化(%s )
104
 export function sprintf(str) {
97
 export function sprintf(str) {
105
 	var args = arguments, flag = true, i = 1;
98
 	var args = arguments, flag = true, i = 1;

+ 1 - 1
ruoyi-ui/src/views/system/user/index.vue

@@ -653,7 +653,7 @@ export default {
653
     importTemplate() {
653
     importTemplate() {
654
       this.download('system/user/importTemplate', {
654
       this.download('system/user/importTemplate', {
655
         ...this.queryParams
655
         ...this.queryParams
656
-      }, `user_${new Date().getTime()}.xlsx`)
656
+      }, `user_template_${new Date().getTime()}.xlsx`)
657
     },
657
     },
658
     // 文件上传中处理
658
     // 文件上传中处理
659
     handleFileUploadProgress(event, file, fileList) {
659
     handleFileUploadProgress(event, file, fileList) {