From 3ccf5c0e502d26f3e6418a123f7e3be676dd9cc7 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 22 Jun 2022 17:57:33 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E7=BC=96=E7=A0=81/=E8=A7=A3=E7=A0=81=E6=96=B9=E4=BE=BF?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=9B=86=E6=88=90=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/utils/ServletUtils.java | 40 +++++++++++++++++++ .../common/utils/file/FileUploadUtils.java | 1 - 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java index d67b2463..1cbf72f0 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java @@ -1,12 +1,16 @@ package com.ruoyi.common.utils; import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.net.URLEncoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; +import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.text.Convert; /** @@ -143,4 +147,40 @@ public class ServletUtils String ajax = request.getParameter("__ajax"); return StringUtils.inStringIgnoreCase(ajax, "json", "xml"); } + + /** + * 内容编码 + * + * @param str 内容 + * @return 编码后的内容 + */ + public static String urlEncode(String str) + { + try + { + return URLEncoder.encode(str, Constants.UTF8); + } + catch (UnsupportedEncodingException e) + { + return StringUtils.EMPTY; + } + } + + /** + * 内容解码 + * + * @param str 内容 + * @return 解码后的内容 + */ + public static String urlDecode(String str) + { + try + { + return URLDecoder.decode(str, Constants.UTF8); + } + catch (UnsupportedEncodingException e) + { + return StringUtils.EMPTY; + } + } } 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 79bf6471..4652a298 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 @@ -193,7 +193,6 @@ public class FileUploadUtils throw new InvalidExtensionException(allowedExtension, extension, fileName); } } - } /** From aaedafff5245583d5a9e40245286f525f888a267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=83=81=E9=94=AE?= Date: Thu, 23 Jun 2022 14:42:10 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E7=8A=B6=E6=80=81=E7=A0=81=E4=B8=BA200,?= =?UTF-8?q?=E4=B8=8E=E5=85=A8=E5=B1=80=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java index 4ce56f15..207c5989 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java @@ -12,7 +12,7 @@ public class R implements Serializable private static final long serialVersionUID = 1L; /** 成功 */ - public static final int SUCCESS = 0; + public static final int SUCCESS = 200; /** 失败 */ public static final int FAIL = 500; From abb88d622ae10d95212054b1589dc3e15614cdc8 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 24 Jun 2022 09:22:05 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E7=8A=B6=E6=80=81=E7=A0=81=E4=B8=8E=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/core/domain/R.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java index 207c5989..c3df6aef 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java @@ -1,6 +1,7 @@ package com.ruoyi.common.core.domain; import java.io.Serializable; +import com.ruoyi.common.constant.HttpStatus; /** * 响应信息主体 @@ -12,10 +13,10 @@ public class R implements Serializable private static final long serialVersionUID = 1L; /** 成功 */ - public static final int SUCCESS = 200; + public static final int SUCCESS = HttpStatus.SUCCESS; /** 失败 */ - public static final int FAIL = 500; + public static final int FAIL = HttpStatus.ERROR; private int code; From 9d7e32fb073842eb9d346878b49ce5bacfa3b51c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 25 Jun 2022 09:39:39 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E8=8F=9C=E5=8D=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/common/CaptchaController.java | 5 +- .../controller/monitor/CacheController.java | 66 +++++ .../monitor/SysUserOnlineController.java | 6 +- .../ruoyi/common/annotation/RateLimiter.java | 4 +- .../ruoyi/common/constant/CacheConstants.java | 39 +++ .../com/ruoyi/common/constant/Constants.java | 32 +-- .../com/ruoyi/common/utils/DictUtils.java | 6 +- .../impl/SameUrlDataInterceptor.java | 4 +- .../web/service/SysLoginService.java | 5 +- .../web/service/SysRegisterService.java | 3 +- .../framework/web/service/TokenService.java | 3 +- .../com/ruoyi/system/domain/SysCache.java | 81 ++++++ .../service/impl/SysConfigServiceImpl.java | 16 +- ruoyi-ui/src/api/monitor/cache.js | 48 ++++ ruoyi-ui/src/assets/icons/svg/redis-list.svg | 2 + ruoyi-ui/src/views/monitor/cache/index.vue | 22 +- ruoyi-ui/src/views/monitor/cache/list.vue | 241 ++++++++++++++++++ sql/{ry_20220613.sql => ry_20220625.sql} | 8 +- 18 files changed, 522 insertions(+), 69 deletions(-) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java create mode 100644 ruoyi-ui/src/assets/icons/svg/redis-list.svg create mode 100644 ruoyi-ui/src/views/monitor/cache/list.vue rename sql/{ry_20220613.sql => ry_20220625.sql} (99%) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java index 955c7843..e8800b94 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java @@ -6,12 +6,13 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Resource; import javax.imageio.ImageIO; import javax.servlet.http.HttpServletResponse; -import com.ruoyi.common.config.RuoYiConfig; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.FastByteArrayOutputStream; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import com.google.code.kaptcha.Producer; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.redis.RedisCache; @@ -54,7 +55,7 @@ public class CaptchaController // 保存验证码信息 String uuid = IdUtils.simpleUUID(); - String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; + String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; String capStr = null, code = null; BufferedImage image = null; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java index fa9c623f..cbd20619 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java @@ -1,19 +1,25 @@ package com.ruoyi.web.controller.monitor; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisCallback; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.SysCache; /** * 缓存监控 @@ -27,6 +33,16 @@ public class CacheController @Autowired private RedisTemplate redisTemplate; + private final static List caches = new ArrayList(); + { + caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息")); + caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息")); + caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典")); + caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码")); + caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交")); + caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理")); + } + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") @GetMapping() public AjaxResult getInfo() throws Exception @@ -50,4 +66,54 @@ public class CacheController result.put("commandStats", pieList); return AjaxResult.success(result); } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @GetMapping("/getNames") + public AjaxResult cache() + { + return AjaxResult.success(caches); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @GetMapping("/getKeys/{cacheName}") + public AjaxResult getCacheKeys(@PathVariable String cacheName) + { + Set cacheKyes = redisTemplate.keys(cacheName + "*"); + return AjaxResult.success(cacheKyes); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @GetMapping("/getValue/{cacheName}/{cacheKey}") + public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) + { + String cacheValue = redisTemplate.opsForValue().get(cacheKey); + SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue); + return AjaxResult.success(sysCache); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @DeleteMapping("/clearCacheName/{cacheName}") + public AjaxResult clearCacheName(@PathVariable String cacheName) + { + Collection cacheKeys = redisTemplate.keys(cacheName + "*"); + redisTemplate.delete(cacheKeys); + return AjaxResult.success(); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @DeleteMapping("/clearCacheKey/{cacheKey}") + public AjaxResult clearCacheKey(@PathVariable String cacheKey) + { + redisTemplate.delete(cacheKey); + return AjaxResult.success(); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @DeleteMapping("/clearCacheAll") + public AjaxResult clearCacheAll() + { + Collection cacheKeys = redisTemplate.keys("*"); + redisTemplate.delete(cacheKeys); + return AjaxResult.success(); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java index 4ca306d7..6c2b3bef 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.model.LoginUser; @@ -42,7 +42,7 @@ public class SysUserOnlineController extends BaseController @GetMapping("/list") public TableDataInfo list(String ipaddr, String userName) { - Collection keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*"); + Collection keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*"); List userOnlineList = new ArrayList(); for (String key : keys) { @@ -86,7 +86,7 @@ public class SysUserOnlineController extends BaseController @DeleteMapping("/{tokenId}") public AjaxResult forceLogout(@PathVariable String tokenId) { - redisCache.deleteObject(Constants.LOGIN_TOKEN_KEY + tokenId); + redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId); return AjaxResult.success(); } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java index 56420386..050ac2d1 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java @@ -5,7 +5,7 @@ import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.enums.LimitType; /** @@ -21,7 +21,7 @@ public @interface RateLimiter /** * 限流key */ - public String key() default Constants.RATE_LIMIT_KEY; + public String key() default CacheConstants.RATE_LIMIT_KEY; /** * 限流时间,单位秒 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java new file mode 100644 index 00000000..7ea15aaa --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java @@ -0,0 +1,39 @@ +package com.ruoyi.common.constant; + +/** + * 缓存的key 常量 + * + * @author ruoyi + */ +public class CacheConstants +{ + /** + * 登录用户 redis key + */ + public static final String LOGIN_TOKEN_KEY = "login_tokens:"; + + /** + * 验证码 redis key + */ + public static final String CAPTCHA_CODE_KEY = "captcha_codes:"; + + /** + * 参数管理 cache key + */ + public static final String SYS_CONFIG_KEY = "sys_config:"; + + /** + * 字典管理 cache key + */ + public static final String SYS_DICT_KEY = "sys_dict:"; + + /** + * 防重提交 redis key + */ + public static final String REPEAT_SUBMIT_KEY = "repeat_submit:"; + + /** + * 限流 redis key + */ + public static final String RATE_LIMIT_KEY = "rate_limit:"; +} 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 6deff23b..2dbdbe64 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 @@ -58,27 +58,7 @@ public class Constants * 登录失败 */ public static final String LOGIN_FAIL = "Error"; - - /** - * 验证码 redis key - */ - public static final String CAPTCHA_CODE_KEY = "captcha_codes:"; - - /** - * 登录用户 redis key - */ - public static final String LOGIN_TOKEN_KEY = "login_tokens:"; - - /** - * 防重提交 redis key - */ - public static final String REPEAT_SUBMIT_KEY = "repeat_submit:"; - - /** - * 限流 redis key - */ - public static final String RATE_LIMIT_KEY = "rate_limit:"; - + /** * 验证码有效期(分钟) */ @@ -124,16 +104,6 @@ public class Constants */ public static final String JWT_AUTHORITIES = "authorities"; - /** - * 参数管理 cache key - */ - public static final String SYS_CONFIG_KEY = "sys_config:"; - - /** - * 字典管理 cache key - */ - public static final String SYS_DICT_KEY = "sys_dict:"; - /** * 资源映射路径 前缀 */ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java index 5a8554b4..39ad84a6 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java @@ -3,7 +3,7 @@ package com.ruoyi.common.utils; import java.util.Collection; import java.util.List; import com.alibaba.fastjson2.JSONArray; -import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.spring.SpringUtils; @@ -169,7 +169,7 @@ public class DictUtils */ public static void clearDictCache() { - Collection keys = SpringUtils.getBean(RedisCache.class).keys(Constants.SYS_DICT_KEY + "*"); + Collection keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.SYS_DICT_KEY + "*"); SpringUtils.getBean(RedisCache.class).deleteObject(keys); } @@ -181,6 +181,6 @@ public class DictUtils */ public static String getCacheKey(String configKey) { - return Constants.SYS_DICT_KEY + configKey; + return CacheConstants.SYS_DICT_KEY + configKey; } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java index 0c5a40d1..316a370c 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java @@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import com.alibaba.fastjson2.JSON; import com.ruoyi.common.annotation.RepeatSubmit; -import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.filter.RepeatedlyRequestWrapper; import com.ruoyi.common.utils.StringUtils; @@ -63,7 +63,7 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor String submitKey = StringUtils.trimToEmpty(request.getHeader(header)); // 唯一标识(指定key + url + 消息头) - String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + url + submitKey; + String cacheRepeatKey = CacheConstants.REPEAT_SUBMIT_KEY + url + submitKey; Object sessionObj = redisCache.getCacheObject(cacheRepeatKey); if (sessionObj != null) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index 6f8b9aa5..5776c522 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -7,6 +7,7 @@ import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.stereotype.Component; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.model.LoginUser; @@ -17,8 +18,8 @@ import com.ruoyi.common.exception.user.CaptchaExpireException; import com.ruoyi.common.exception.user.UserPasswordNotMatchException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.MessageUtils; -import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.ip.IpUtils; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; @@ -103,7 +104,7 @@ public class SysLoginService */ public void validateCaptcha(String username, String code, String uuid) { - String verifyKey = Constants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); + String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); String captcha = redisCache.getCacheObject(verifyKey); redisCache.deleteObject(verifyKey); if (captcha == null) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java index c7de444e..43b1ce3c 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java @@ -2,6 +2,7 @@ package com.ruoyi.framework.web.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.entity.SysUser; @@ -100,7 +101,7 @@ public class SysRegisterService */ public void validateCaptcha(String username, String code, String uuid) { - String verifyKey = Constants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); + String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); String captcha = redisCache.getCacheObject(verifyKey); redisCache.deleteObject(verifyKey); if (captcha == null) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java index 5b4c4146..cadeb4e3 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java @@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.redis.RedisCache; @@ -220,6 +221,6 @@ public class TokenService private String getTokenKey(String uuid) { - return Constants.LOGIN_TOKEN_KEY + uuid; + return CacheConstants.LOGIN_TOKEN_KEY + uuid; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java new file mode 100644 index 00000000..2ee82120 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java @@ -0,0 +1,81 @@ +package com.ruoyi.system.domain; + +import com.ruoyi.common.utils.StringUtils; + +/** + * 缓存信息 + * + * @author ruoyi + */ +public class SysCache +{ + /** 缓存名称 */ + private String cacheName = ""; + + /** 缓存键名 */ + private String cacheKey = ""; + + /** 缓存内容 */ + private String cacheValue = ""; + + /** 备注 */ + private String remark = ""; + + public SysCache() + { + + } + + public SysCache(String cacheName, String remark) + { + this.cacheName = cacheName; + this.remark = remark; + } + + public SysCache(String cacheName, String cacheKey, String cacheValue) + { + this.cacheName = StringUtils.replace(cacheName, ":", ""); + this.cacheKey = StringUtils.replace(cacheKey, cacheName, ""); + this.cacheValue = cacheValue; + } + + public String getCacheName() + { + return cacheName; + } + + public void setCacheName(String cacheName) + { + this.cacheName = cacheName; + } + + public String getCacheKey() + { + return cacheKey; + } + + public void setCacheKey(String cacheKey) + { + this.cacheKey = cacheKey; + } + + public String getCacheValue() + { + return cacheValue; + } + + public void setCacheValue(String cacheValue) + { + this.cacheValue = cacheValue; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java index c258a488..1017d23f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -1,7 +1,12 @@ package com.ruoyi.system.service.impl; +import java.util.Collection; +import java.util.List; +import javax.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import com.ruoyi.common.annotation.DataSource; -import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.text.Convert; @@ -11,11 +16,6 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.SysConfig; import com.ruoyi.system.mapper.SysConfigMapper; import com.ruoyi.system.service.ISysConfigService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; -import java.util.Collection; -import java.util.List; /** * 参数配置 服务层实现 @@ -181,7 +181,7 @@ public class SysConfigServiceImpl implements ISysConfigService @Override public void clearConfigCache() { - Collection keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); + Collection keys = redisCache.keys(CacheConstants.SYS_CONFIG_KEY + "*"); redisCache.deleteObject(keys); } @@ -221,6 +221,6 @@ public class SysConfigServiceImpl implements ISysConfigService */ private String getCacheKey(String configKey) { - return Constants.SYS_CONFIG_KEY + configKey; + return CacheConstants.SYS_CONFIG_KEY + configKey; } } diff --git a/ruoyi-ui/src/api/monitor/cache.js b/ruoyi-ui/src/api/monitor/cache.js index 2ffaf7a3..e1f2c878 100644 --- a/ruoyi-ui/src/api/monitor/cache.js +++ b/ruoyi-ui/src/api/monitor/cache.js @@ -7,3 +7,51 @@ export function getCache() { method: 'get' }) } + +// 查询缓存名称列表 +export function listCacheName() { + return request({ + url: '/monitor/cache/getNames', + method: 'get' + }) +} + +// 查询缓存键名列表 +export function listCacheKey(cacheName) { + return request({ + url: '/monitor/cache/getKeys/' + cacheName, + method: 'get' + }) +} + +// 查询缓存内容 +export function getCacheValue(cacheName, cacheKey) { + return request({ + url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey, + method: 'get' + }) +} + +// 清理指定名称缓存 +export function clearCacheName(cacheName) { + return request({ + url: '/monitor/cache/clearCacheName/' + cacheName, + method: 'delete' + }) +} + +// 清理指定键名缓存 +export function clearCacheKey(cacheKey) { + return request({ + url: '/monitor/cache/clearCacheKey/' + cacheKey, + method: 'delete' + }) +} + +// 清理全部缓存 +export function clearCacheAll() { + return request({ + url: '/monitor/cache/clearCacheAll', + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/assets/icons/svg/redis-list.svg b/ruoyi-ui/src/assets/icons/svg/redis-list.svg new file mode 100644 index 00000000..98a15b2a --- /dev/null +++ b/ruoyi-ui/src/assets/icons/svg/redis-list.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ruoyi-ui/src/views/monitor/cache/index.vue b/ruoyi-ui/src/views/monitor/cache/index.vue index cafa28cf..cfef20d9 100644 --- a/ruoyi-ui/src/views/monitor/cache/index.vue +++ b/ruoyi-ui/src/views/monitor/cache/index.vue @@ -71,7 +71,7 @@ import { getCache } from "@/api/monitor/cache"; import echarts from "echarts"; export default { - name: "Server", + name: "Cache", data() { return { // 统计命令信息 @@ -79,8 +79,8 @@ export default { // 使用内存 usedmemory: null, // cache信息 - cache: [], - }; + cache: [] + } }, created() { this.getList(); @@ -109,8 +109,8 @@ export default { data: response.data.commandStats, animationEasing: "cubicInOut", animationDuration: 1000, - }, - ], + } + ] }); this.usedmemory = echarts.init(this.$refs.usedmemory, "macarons"); this.usedmemory.setOption({ @@ -130,17 +130,17 @@ export default { { value: parseFloat(this.cache.info.used_memory_human), name: "内存消耗", - }, - ], - }, - ], + } + ] + } + ] }); }); }, // 打开加载层 openLoading() { this.$modal.loading("正在加载缓存监控数据,请稍候!"); - }, - }, + } + } }; diff --git a/ruoyi-ui/src/views/monitor/cache/list.vue b/ruoyi-ui/src/views/monitor/cache/list.vue new file mode 100644 index 00000000..4e52b318 --- /dev/null +++ b/ruoyi-ui/src/views/monitor/cache/list.vue @@ -0,0 +1,241 @@ + + + diff --git a/sql/ry_20220613.sql b/sql/ry_20220625.sql similarity index 99% rename from sql/ry_20220613.sql rename to sql/ry_20220625.sql index 36ba9365..e9e6580a 100644 --- a/sql/ry_20220613.sql +++ b/sql/ry_20220625.sql @@ -176,9 +176,10 @@ insert into sys_menu values('110', '定时任务', '2', '2', 'job', 'm insert into sys_menu values('111', '数据监控', '2', '3', 'druid', 'monitor/druid/index', '', 1, 0, 'C', '0', '0', 'monitor:druid:list', 'druid', 'admin', sysdate(), '', null, '数据监控菜单'); insert into sys_menu values('112', '服务监控', '2', '4', 'server', 'monitor/server/index', '', 1, 0, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', sysdate(), '', null, '服务监控菜单'); insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 'admin', sysdate(), '', null, '缓存监控菜单'); -insert into sys_menu values('114', '表单构建', '3', '1', 'build', 'tool/build/index', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', sysdate(), '', null, '表单构建菜单'); -insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', sysdate(), '', null, '代码生成菜单'); -insert into sys_menu values('116', '系统接口', '3', '3', 'swagger', 'tool/swagger/index', '', 1, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', sysdate(), '', null, '系统接口菜单'); +insert into sys_menu values('114', '缓存列表', '2', '6', 'cacheList', 'monitor/cache/list', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis-list', 'admin', sysdate(), '', null, '缓存列表菜单'); +insert into sys_menu values('115', '表单构建', '3', '1', 'build', 'tool/build/index', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', sysdate(), '', null, '表单构建菜单'); +insert into sys_menu values('116', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', sysdate(), '', null, '代码生成菜单'); +insert into sys_menu values('117', '系统接口', '3', '3', 'swagger', 'tool/swagger/index', '', 1, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', sysdate(), '', null, '系统接口菜单'); -- 三级菜单 insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', '', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 'admin', sysdate(), '', null, '操作日志菜单'); insert into sys_menu values('501', '登录日志', '108', '2', 'logininfor', 'monitor/logininfor/index', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 'admin', sysdate(), '', null, '登录日志菜单'); @@ -308,6 +309,7 @@ insert into sys_role_menu values ('2', '113'); insert into sys_role_menu values ('2', '114'); insert into sys_role_menu values ('2', '115'); insert into sys_role_menu values ('2', '116'); +insert into sys_role_menu values ('2', '117'); insert into sys_role_menu values ('2', '500'); insert into sys_role_menu values ('2', '501'); insert into sys_role_menu values ('2', '1000'); From 89eb44afbc1805ea4afd9b03f3a16cf8460cdeee Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 26 Jun 2022 08:53:15 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=9B=9E=E6=98=BE=E6=A0=B7=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E6=98=BE=E7=A4=BA=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/system/dict/data.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/src/views/system/dict/data.vue b/ruoyi-ui/src/views/system/dict/data.vue index 1d0be70a..a68a6012 100644 --- a/ruoyi-ui/src/views/system/dict/data.vue +++ b/ruoyi-ui/src/views/system/dict/data.vue @@ -163,7 +163,7 @@ From 8c956d681b3522bb880d6f0f6b5186d20a0b1149 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 26 Jun 2022 08:53:56 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=8D=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E5=8E=8B=E7=BC=A9=E6=96=87=E4=BB=B6=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=98=B2=E6=AD=A2node=5Fmodules=E8=BF=87=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/vue.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 1a9e913d..2506c93a 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -61,6 +61,7 @@ module.exports = { plugins: [ // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 new CompressionPlugin({ + cache: false, // 不启用文件缓存 test: /\.(js|css|html)?$/i, // 压缩文件格式 filename: '[path].gz[query]', // 压缩后的文件名 algorithm: 'gzip', // 使用gzip压缩 From ef31a0de420a623c3ed6a4eb7159d965ed9c7b62 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 26 Jun 2022 10:37:45 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=8D=87=E7=BA=A7fastjson=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=882.0.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d1cf3c11..0d5ed92e 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 2.3.2 2.2.2 1.4.1 - 2.0.7 + 2.0.8 6.1.6 2.11.0 1.4 From 47b8daf69cba3d6306510bbb67b04914dd349fb0 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 26 Jun 2022 13:10:44 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E5=AD=97=E5=85=B8=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84mapper=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java index 81bc7809..132a72ed 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java @@ -1,7 +1,6 @@ package com.ruoyi.system.mapper; import java.util.List; -import org.apache.ibatis.annotations.Mapper; import com.ruoyi.common.core.domain.entity.SysDictType; /** @@ -9,7 +8,6 @@ import com.ruoyi.common.core.domain.entity.SysDictType; * * @author ruoyi */ -@Mapper public interface SysDictTypeMapper { /** From 2ae41df23b73cdfbb2f8c32b1ef019ed6a06ea27 Mon Sep 17 00:00:00 2001 From: zbk <540064991@qq.com> Date: Sun, 26 Jun 2022 12:51:55 +0000 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=E5=8F=98=E9=87=8F=E5=90=8D?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/monitor/cache/list.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/src/views/monitor/cache/list.vue b/ruoyi-ui/src/views/monitor/cache/list.vue index 4e52b318..64dd9189 100644 --- a/ruoyi-ui/src/views/monitor/cache/list.vue +++ b/ruoyi-ui/src/views/monitor/cache/list.vue @@ -121,7 +121,7 @@ >清理全部 - + From 6f48fc3c581338addc1c9012149ffeb68b0e7815 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 27 Jun 2022 08:23:47 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E8=8B=A5=E4=BE=9D=203.8.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- pom.xml | 4 +- ruoyi-admin/pom.xml | 2 +- .../src/main/resources/application.yml | 2 +- ruoyi-common/pom.xml | 2 +- ruoyi-framework/pom.xml | 2 +- ruoyi-generator/pom.xml | 2 +- ruoyi-quartz/pom.xml | 2 +- ruoyi-system/pom.xml | 2 +- ruoyi-ui/package.json | 2 +- ruoyi-ui/src/views/index.vue | 40 ++++++++++++++++++- 11 files changed, 51 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 20ea55b8..b934ad53 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@

logo

-

RuoYi v3.8.2

+

RuoYi v3.8.3

基于SpringBoot+Vue前后端分离的Java快速开发框架

- +

diff --git a/pom.xml b/pom.xml index 0d5ed92e..b7a16b20 100644 --- a/pom.xml +++ b/pom.xml @@ -6,14 +6,14 @@ com.ruoyi ruoyi - 3.8.2 + 3.8.3 ruoyi http://www.ruoyi.vip 若依管理系统 - 3.8.2 + 3.8.3 UTF-8 UTF-8 1.8 diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index ba3cab48..68a92226 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.2 + 3.8.3 4.0.0 jar diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 5fa30a4e..da9c7475 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -3,7 +3,7 @@ ruoyi: # 名称 name: RuoYi # 版本 - version: 3.8.2 + version: 3.8.3 # 版权年份 copyrightYear: 2022 # 实例演示开关 diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 0e687a7d..31486d7d 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.2 + 3.8.3 4.0.0 diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml index 39b2d88c..105f3829 100644 --- a/ruoyi-framework/pom.xml +++ b/ruoyi-framework/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.2 + 3.8.3 4.0.0 diff --git a/ruoyi-generator/pom.xml b/ruoyi-generator/pom.xml index 426bc2c8..d7a1cafa 100644 --- a/ruoyi-generator/pom.xml +++ b/ruoyi-generator/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.2 + 3.8.3 4.0.0 diff --git a/ruoyi-quartz/pom.xml b/ruoyi-quartz/pom.xml index ea2b8ef5..4d94d1cf 100644 --- a/ruoyi-quartz/pom.xml +++ b/ruoyi-quartz/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.2 + 3.8.3 4.0.0 diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index cdd5bb63..ac27bdb6 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.2 + 3.8.3 4.0.0 diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 50377539..b4fb1b68 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -1,6 +1,6 @@ { "name": "ruoyi", - "version": "3.8.2", + "version": "3.8.3", "description": "若依管理系统", "author": "若依", "license": "MIT", diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index 08eb055e..3d9111d7 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -147,6 +147,44 @@ 更新日志 + +
    +
  1. 新增缓存列表菜单功能
  2. +
  3. 代码生成树表新增(展开/折叠)
  4. +
  5. Excel注解支持color字体颜色
  6. +
  7. 新增Anonymous匿名访问不鉴权注解
  8. +
  9. 用户头像上传限制只能为图片格式
  10. +
  11. 接口使用泛型使其看到响应属性字段
  12. +
  13. 检查定时任务bean所在包名是否为白名单配置
  14. +
  15. 添加页签openPage支持传递参数
  16. +
  17. 用户缓存信息添加部门ancestors祖级列表
  18. +
  19. 升级element-ui到最新版本2.15.8
  20. +
  21. 升级oshi到最新版本6.1.6
  22. +
  23. 升级druid到最新版本1.2.11
  24. +
  25. 升级fastjson到最新版2.0.8
  26. +
  27. 升级spring-boot到最新版本2.5.14
  28. +
  29. 降级jsencrypt版本兼容IE浏览器
  30. +
  31. 删除多余的salt字段
  32. +
  33. 新增获取不带后缀文件名称方法
  34. +
  35. 新增获取配置文件中的属性值方法
  36. +
  37. 新增内容编码/解码方便插件集成使用
  38. +
  39. 字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)
  40. +
  41. 优化设置分页参数默认值
  42. +
  43. 优化对空字符串参数处理的过滤
  44. +
  45. 优化显示顺序orderNum类型为整型
  46. +
  47. 优化表单构建按钮不显示正则校验
  48. +
  49. 优化字典数据回显样式下拉框显示值
  50. +
  51. 优化R响应成功状态码与全局保持一致
  52. +
  53. 优化druid开启wall过滤器出现的异常问题
  54. +
  55. 优化用户管理左侧树型组件增加选中高亮保持
  56. +
  57. 优化新增用户与角色信息&用户与岗位信息逻辑
  58. +
  59. 优化默认不启用压缩文件缓存防止node_modules过大
  60. +
  61. 修复字典数据显示不全问题
  62. +
  63. 修复操作日志查询类型条件为0时会查到所有数据
  64. +
  65. 修复Excel注解prompt/combo同时使用不生效问题
  66. +
  67. 其他细节优化
  68. +
+
  1. 前端支持设置是否需要防止数据重复提交
  2. @@ -797,7 +835,7 @@ export default { data() { return { // 版本号 - version: "3.8.2", + version: "3.8.3", }; }, methods: { From 0a893d196e907a335cfec5d3d5b13e1f8ecd15ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Tue, 5 Jul 2022 02:06:31 +0000 Subject: [PATCH 11/11] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=E9=AD=94?= =?UTF-8?q?=E6=B3=95=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/filter/RepeatedlyRequestWrapper.java | 7 ++++--- .../src/main/java/com/ruoyi/common/filter/XssFilter.java | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java index caacba63..ca822ede 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java @@ -10,6 +10,7 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import com.ruoyi.common.utils.http.HttpHelper; +import com.ruoyi.common.constant.Constants; /** * 构建可重复读取inputStream的request @@ -23,10 +24,10 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException { super(request); - request.setCharacterEncoding("UTF-8"); - response.setCharacterEncoding("UTF-8"); + request.setCharacterEncoding(Constants.UTF8); + response.setCharacterEncoding(Constants.UTF8); - body = HttpHelper.getBodyString(request).getBytes("UTF-8"); + body = HttpHelper.getBodyString(request).getBytes(Constants.UTF8); } @Override diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java index 703ce9ac..23a76fe1 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java @@ -12,6 +12,7 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.enums.HttpMethod; /** * 防止XSS攻击的过滤器 @@ -59,7 +60,7 @@ public class XssFilter implements Filter String url = request.getServletPath(); String method = request.getMethod(); // GET DELETE 不过滤 - if (method == null || method.matches("GET") || method.matches("DELETE")) + if (method == null || HttpMethod.GET.matches(method) || HttpMethod.DELETE.matches(method)) { return true; }