bug修复

This commit is contained in:
18792927508
2024-04-29 16:37:57 +08:00
parent 09c3555645
commit 95a91b4189
6 changed files with 13 additions and 30 deletions
@@ -2,12 +2,10 @@ package com.ruoyi;
import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.mapper.SysDeptMapper;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import org.springframework.boot.SpringApplication;
@@ -59,13 +57,6 @@ public class RuoYiApplication
redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
}
}
// 初始化部门redis
SysDeptMapper deptMapper = SpringUtils.getBean(SysDeptMapper.class);
List<SysDept> depts = deptMapper.selectDeptList(new SysDept());
if(CollectionUtil.isNotEmpty(depts)){
for (SysDept dept : depts) {
redisCache.setCacheObject(CacheConstants.DEPT_KEY+dept.getDeptName(),dept.getDeptId());
}
}
}
}