From cc0efa3330993d328ca2d1045eee76334b9e53d4 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期三, 29 五月 2024 14:48:23 +0800 Subject: [PATCH] 优化代码 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) 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 cbd2061..504c0fd 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 @@ -7,6 +7,7 @@ import java.util.Map; import java.util.Properties; import java.util.Set; +import java.util.TreeSet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisCallback; import org.springframework.data.redis.core.RedisTemplate; @@ -41,6 +42,7 @@ caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码")); caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交")); caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理")); + caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数")); } @PreAuthorize("@ss.hasPermi('monitor:cache:list')") @@ -78,8 +80,8 @@ @GetMapping("/getKeys/{cacheName}") public AjaxResult getCacheKeys(@PathVariable String cacheName) { - Set<String> cacheKyes = redisTemplate.keys(cacheName + "*"); - return AjaxResult.success(cacheKyes); + Set<String> cacheKeys = redisTemplate.keys(cacheName + "*"); + return AjaxResult.success(new TreeSet<>(cacheKeys)); } @PreAuthorize("@ss.hasPermi('monitor:cache:list')") -- Gitblit v1.9.2