解决“在只填加了字典类型,没有添加字典数据时,会出现缓存了空集合,即使后边添加了字典数据也没用,只能清空redis缓存。”的问题,小问题就是判断稍稍改了下,若依大大让我pr当个贡献者,很荣幸很欣慰。感谢!

master
dawn 4 years ago
parent 4f86b6d9ca
commit 3fd9147afb
  1. 4
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java

@ -76,12 +76,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
public List<SysDictData> selectDictDataByType(String dictType)
{
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
if (StringUtils.isNotNull(dictDatas))
if (null!=dictDatas&&!dictDatas.isEmpty())
{
return dictDatas;
}
dictDatas = dictDataMapper.selectDictDataByType(dictType);
if (StringUtils.isNotNull(dictDatas))
if (null!=dictDatas&&!dictDatas.isEmpty())
{
DictUtils.setDictCache(dictType, dictDatas);
return dictDatas;

Loading…
Cancel
Save