Compare commits

...

3 Commits

Author SHA1 Message Date
e5716bdfc2 Merge branch 'master-jdk17' into feature-project 2024-11-22 11:14:11 +08:00
芋道源码
b48842091c
!1129 解决编辑租户套餐时菜单权限因缓存导致无法生效的问题
Merge pull request !1129 from 杨宇庆/N/A
2024-11-19 01:09:01 +00:00
杨宇庆
f782e3a9af
解决编辑租户套餐时菜单权限因缓存导致无法生效的问题
Signed-off-by: 杨宇庆 <hiyyq@qq.com>
2024-11-18 08:06:52 +00:00

View File

@ -132,8 +132,12 @@ public class PermissionServiceImpl implements PermissionService {
@Override
@DSTransactional // 多数据源使用 @DSTransactional 保证本地事务以及数据源的切换
@Caching(evict = {
@CacheEvict(value = RedisKeyConstants.MENU_ROLE_ID_LIST,
allEntries = true),
@CacheEvict(value = RedisKeyConstants.PERMISSION_MENU_ID_LIST,
allEntries = true) // allEntries 清空所有缓存主要一次更新涉及到的 menuIds 较多反倒批量会更快
})
public void assignRoleMenu(Long roleId, Set<Long> menuIds) {
// 获得角色拥有菜单编号
Set<Long> dbMenuIds = convertSet(roleMenuMapper.selectListByRoleId(roleId), RoleMenuDO::getMenuId);