【8.1.0】【role】更新角色修改,清空缓存

pull/60/head
fengshuonan 2024-01-23 16:04:30 +08:00
parent 4b0b037501
commit 141d97b99d
2 changed files with 9 additions and 0 deletions

View File

@ -71,6 +71,9 @@ public class SysRoleMenuOptionsServiceImpl extends ServiceImpl<SysRoleMenuOption
} else {
this.saveBatch(sysRoleMenuOptionList);
}
// 清空角色和菜单功能的绑定
roleMenuOptionsCache.remove(String.valueOf(roleId));
}
@Override
@ -123,6 +126,9 @@ public class SysRoleMenuOptionsServiceImpl extends ServiceImpl<SysRoleMenuOption
LambdaQueryWrapper<SysRoleMenuOptions> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SysRoleMenuOptions::getRoleId, beRemovedRoleIdList);
this.remove(wrapper);
// 清空角色和菜单功能的绑定
roleMenuOptionsCache.remove(beRemovedRoleIdList.stream().map(Object::toString).collect(Collectors.toList()));
}
@Override

View File

@ -61,6 +61,9 @@ public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRo
} else {
this.saveBatch(sysRoleMenus);
}
// 清空角色和菜单的缓存
roleMenuCache.remove(String.valueOf(roleId));
}
@Override