From f7b09130722fbf6dc485692e43f0ee77a54196bc Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期五, 15 四月 2022 09:28:20 +0800 Subject: [PATCH] 字典类型必须以字母开头,且只能为(小写字母,数字,下滑线) --- src/main/java/com/ruoyi/common/utils/DictUtils.java | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ruoyi/common/utils/DictUtils.java b/src/main/java/com/ruoyi/common/utils/DictUtils.java index e3d3612..be6a73c 100644 --- a/src/main/java/com/ruoyi/common/utils/DictUtils.java +++ b/src/main/java/com/ruoyi/common/utils/DictUtils.java @@ -41,8 +41,7 @@ Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); if (StringUtils.isNotNull(cacheObj)) { - List<SysDictData> dictDatas = StringUtils.cast(cacheObj); - return dictDatas; + return StringUtils.cast(cacheObj); } return null; } @@ -92,7 +91,7 @@ { if (value.equals(dict.getDictValue())) { - propertyString.append(dict.getDictLabel() + separator); + propertyString.append(dict.getDictLabel()).append(separator); break; } } @@ -132,7 +131,7 @@ { if (label.equals(dict.getDictLabel())) { - propertyString.append(dict.getDictValue() + separator); + propertyString.append(dict.getDictValue()).append(separator); break; } } @@ -152,6 +151,16 @@ } /** + * 鍒犻櫎鎸囧畾瀛楀吀缂撳瓨 + * + * @param key 瀛楀吀閿� + */ + public static void removeDictCache(String key) + { + SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key)); + } + + /** * 娓呯┖瀛楀吀缂撳瓨 */ public static void clearDictCache() -- Gitblit v1.9.3