Przeglądaj źródła

update 优化字典工具写法

疯狂的狮子li 3 lat temu
rodzic
commit
b374ff4d6d

+ 2 - 3
ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java

@@ -36,9 +36,8 @@ public class DictUtils {
      * @return dictDatas 字典数据列表
      */
     public static List<SysDictData> getDictCache(String key) {
-        Object cacheObj = RedisUtils.getCacheObject(getCacheKey(key));
-        if (StringUtils.isNotNull(cacheObj)) {
-            List<SysDictData> dictDatas = (List<SysDictData>) cacheObj;
+        List<SysDictData> dictDatas = RedisUtils.getCacheObject(getCacheKey(key));
+        if (StringUtils.isNotNull(dictDatas)) {
             return dictDatas;
         }
         return null;