From 3ee2cb62e319ebe14046787cb3743106e941bac4 Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:00:59 +0800 Subject: [PATCH 01/13] 11111 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e28de74d..9b24401c0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## 平台简介 - +111 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了若依。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 性别男,若依是给还没有出生女儿取的名字(寓意:你若不离不弃,我必生死相依) From 2a3ee2b24c18599e0cc5c1f7823c9f1ec18702c0 Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:24:42 +0800 Subject: [PATCH 02/13] 11111 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index bc23291c0..89a39009a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ The MIT License (MIT) - +1111 Copyright (c) 2018 RuoYi Permission is hereby granted, free of charge, to any person obtaining a copy of From d3933e3014234eee0b2f5845318a0de5fac97612 Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:36:52 +0800 Subject: [PATCH 03/13] 11111 --- LICENSE | 1 - README.md | 1 - 2 files changed, 2 deletions(-) diff --git a/LICENSE b/LICENSE index 89a39009a..86853ab12 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,4 @@ The MIT License (MIT) -1111 Copyright (c) 2018 RuoYi Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/README.md b/README.md index 9b24401c0..6945b225c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ ## 平台简介 -111 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了若依。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 性别男,若依是给还没有出生女儿取的名字(寓意:你若不离不弃,我必生死相依) From a85d9b28e691fdaf2a9a197a87053cc26fa888ee Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:39:38 +0800 Subject: [PATCH 04/13] 11111 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6945b225c..401b89b15 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ > 如需单应用,请移步 [RuoYi-fast](https://gitee.com/y_project/RuoYi-fast) `(保持同步更新)`,如需其他版本,请移步 [项目扩展](http://doc.ruoyi.vip/#/standard/xmkz) `(不定时更新)` -> 阿里云通用云产品1888优惠券 :[点我领取](https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof)    腾讯云通用云产品2860优惠券 :[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  `(仅限新用户)` +> 阿里云通用云产品 1888优惠券 :[点我领取](https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof)    腾讯云通用云产品2860优惠券 :[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  `(仅限新用户)` > 阿里云Hi拼购 限量爆款 低至199元/年 [点我进入](https://www.aliyun.com/acts/hi-group-buying?userCode=brki8iof)  `(仅限新用户)` From 2f7f1f0d84f03f09ef65c7614f0af8c90fc56697 Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:00:59 +0800 Subject: [PATCH 05/13] 11111 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e28de74d..9b24401c0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## 平台简介 - +111 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了若依。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 性别男,若依是给还没有出生女儿取的名字(寓意:你若不离不弃,我必生死相依) From 39cbde42ccf5d1f111b71284639b2f06c45f9d38 Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:24:42 +0800 Subject: [PATCH 06/13] 11111 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index bc23291c0..89a39009a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ The MIT License (MIT) - +1111 Copyright (c) 2018 RuoYi Permission is hereby granted, free of charge, to any person obtaining a copy of From 5c263297b02394252456d039e5a372afceb3e17b Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:36:52 +0800 Subject: [PATCH 07/13] 11111 --- LICENSE | 1 - README.md | 1 - 2 files changed, 2 deletions(-) diff --git a/LICENSE b/LICENSE index 89a39009a..86853ab12 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,4 @@ The MIT License (MIT) -1111 Copyright (c) 2018 RuoYi Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/README.md b/README.md index 9b24401c0..6945b225c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ ## 平台简介 -111 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了若依。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 性别男,若依是给还没有出生女儿取的名字(寓意:你若不离不弃,我必生死相依) From 81e8229700b86ac3ef9442c23b60053e60af5cc0 Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:39:38 +0800 Subject: [PATCH 08/13] 11111 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6945b225c..401b89b15 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ > 如需单应用,请移步 [RuoYi-fast](https://gitee.com/y_project/RuoYi-fast) `(保持同步更新)`,如需其他版本,请移步 [项目扩展](http://doc.ruoyi.vip/#/standard/xmkz) `(不定时更新)` -> 阿里云通用云产品1888优惠券 :[点我领取](https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof)    腾讯云通用云产品2860优惠券 :[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  `(仅限新用户)` +> 阿里云通用云产品 1888优惠券 :[点我领取](https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof)    腾讯云通用云产品2860优惠券 :[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  `(仅限新用户)` > 阿里云Hi拼购 限量爆款 低至199元/年 [点我进入](https://www.aliyun.com/acts/hi-group-buying?userCode=brki8iof)  `(仅限新用户)` From 95c26ba4bfe9e4b865575ef0e119abeb9080dd4a Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 23 Aug 2019 10:36:03 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E9=80=9A=E7=94=A8=E4=B8=8B=E8=BD=BD=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/common/CommonController.java | 21 +++++++++++++++++++ .../java/com/ruoyi/common/config/Global.java | 2 +- .../com/ruoyi/common/constant/Constants.java | 5 +++++ .../common/utils/file/FileUploadUtils.java | 3 ++- .../framework/config/ResourcesConfig.java | 3 ++- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java index fa80f5f10..c8f7e3ad0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.Global; import com.ruoyi.common.config.ServerConfig; +import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.file.FileUploadUtils; @@ -88,4 +89,24 @@ public class CommonController return AjaxResult.error(e.getMessage()); } } + + /** + * 本地资源通用下载 + */ + @GetMapping("/common/download/resource") + public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) + throws Exception + { + // 本地资源路径 + String localPath = Global.getProfile(); + // 数据库资源地址 + String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX); + // 下载名称 + String downloadName = StringUtils.substringAfterLast(downloadPath, "/"); + response.setCharacterEncoding("utf-8"); + response.setContentType("multipart/form-data"); + response.setHeader("Content-Disposition", + "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName)); + FileUtils.writeBytes(downloadPath, response.getOutputStream()); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/Global.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/Global.java index 7509d3ae7..beb6e831e 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/config/Global.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/Global.java @@ -129,7 +129,7 @@ public class Global */ public static String getDownloadPath() { - return getProfile() + "/download"; + return getProfile() + "/download/"; } /** diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java index 1a52c1f7f..9cee41d0a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -61,4 +61,9 @@ public class Constants * 排序的方向 "desc" 或者 "asc". */ public static final String IS_ASC = "isAsc"; + + /** + * 资源映射路径 前缀 + */ + public static final String RESOURCE_PREFIX = "/profile"; } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java index 6190a566b..36c332790 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -5,6 +5,7 @@ import java.io.IOException; import org.apache.commons.io.FilenameUtils; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.Global; +import com.ruoyi.common.constant.Constants; import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException; import com.ruoyi.common.exception.file.FileSizeLimitExceededException; import com.ruoyi.common.exception.file.InvalidExtensionException; @@ -147,7 +148,7 @@ public class FileUploadUtils { int dirLastIndex = uploadDir.lastIndexOf("/") + 1; String currentDir = StringUtils.substring(uploadDir, dirLastIndex); - String pathFileName = "/profile/" + currentDir + "/" + fileName; + String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; return pathFileName; } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java index a927e1a46..999ccb063 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java @@ -8,6 +8,7 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import com.ruoyi.common.config.Global; +import com.ruoyi.common.constant.Constants; import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; /** @@ -40,7 +41,7 @@ public class ResourcesConfig implements WebMvcConfigurer public void addResourceHandlers(ResourceHandlerRegistry registry) { /** 本地文件上传路径 */ - registry.addResourceHandler("/profile/**").addResourceLocations("file:" + Global.getProfile() + "/"); + registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + Global.getProfile() + "/"); /** swagger配置 */ registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); From 0443d3dcc51c630308377a5a0eb7a1b5a6356eae Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 25 Aug 2019 22:16:58 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E4=BF=AE=E5=A4=8DexpireTime=E4=BC=9A?= =?UTF-8?q?=E8=AF=9D=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E6=97=A0=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../src/main/resources/application.yml | 2 +- .../main/resources/ehcache/ehcache-shiro.xml | 27 ++++++++++++++++--- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index b13b00693..62eb104df 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ UTF-8 UTF-8 1.8 - 1.4.0 + 1.4.1 2.0.0 1.3.2 1.1.14 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 15e79712b..5d8829300 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -109,7 +109,7 @@ shiro: # 设置Cookie的过期时间,天为单位 maxAge: 30 session: - # Session超时时间(默认30分钟) + # Session超时时间,-1代表永不过期(默认30分钟) expireTime: 30 # 同步session到数据库的周期(默认1分钟) dbSyncPeriod: 1 diff --git a/ruoyi-admin/src/main/resources/ehcache/ehcache-shiro.xml b/ruoyi-admin/src/main/resources/ehcache/ehcache-shiro.xml index 66c01c30b..0ff3c1e23 100644 --- a/ruoyi-admin/src/main/resources/ehcache/ehcache-shiro.xml +++ b/ruoyi-admin/src/main/resources/ehcache/ehcache-shiro.xml @@ -3,7 +3,15 @@ - + + + + + + + + + - - + + - + + + + + \ No newline at end of file From 2148c6cb7c4543d4bc2bccbc6293bbeb4aad7cd9 Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:00:59 +0800 Subject: [PATCH 11/13] 11111 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 401b89b15..2e28de74d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ## 平台简介 + 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了若依。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 性别男,若依是给还没有出生女儿取的名字(寓意:你若不离不弃,我必生死相依) @@ -7,7 +8,7 @@ > 如需单应用,请移步 [RuoYi-fast](https://gitee.com/y_project/RuoYi-fast) `(保持同步更新)`,如需其他版本,请移步 [项目扩展](http://doc.ruoyi.vip/#/standard/xmkz) `(不定时更新)` -> 阿里云通用云产品 1888优惠券 :[点我领取](https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof)    腾讯云通用云产品2860优惠券 :[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  `(仅限新用户)` +> 阿里云通用云产品1888优惠券 :[点我领取](https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof)    腾讯云通用云产品2860优惠券 :[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  `(仅限新用户)` > 阿里云Hi拼购 限量爆款 低至199元/年 [点我进入](https://www.aliyun.com/acts/hi-group-buying?userCode=brki8iof)  `(仅限新用户)` From 80705022a33862973433da40020c578cd5c7212f Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:24:42 +0800 Subject: [PATCH 12/13] 11111 --- LICENSE | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE b/LICENSE index 86853ab12..bc23291c0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ The MIT License (MIT) + Copyright (c) 2018 RuoYi Permission is hereby granted, free of charge, to any person obtaining a copy of From ac144e4c9a9add224d9f7711a2231fcb0d52831c Mon Sep 17 00:00:00 2001 From: Administrator <727195225@qq.com> Date: Fri, 23 Aug 2019 16:39:38 +0800 Subject: [PATCH 13/13] 11111 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e28de74d..e2a12b591 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ > 如需单应用,请移步 [RuoYi-fast](https://gitee.com/y_project/RuoYi-fast) `(保持同步更新)`,如需其他版本,请移步 [项目扩展](http://doc.ruoyi.vip/#/standard/xmkz) `(不定时更新)` -> 阿里云通用云产品1888优惠券 :[点我领取](https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof)    腾讯云通用云产品2860优惠券 :[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  `(仅限新用户)` +> 阿里云通用云产品 1888优惠券 :[点我领取](https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof)    腾讯云通用云产品2860优惠券 :[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  `(仅限新用户)` > 阿里云Hi拼购 限量爆款 低至199元/年 [点我进入](https://www.aliyun.com/acts/hi-group-buying?userCode=brki8iof)  `(仅限新用户)`