mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-02 18:46:13 +00:00
update 优化 角色编辑状态未校验问题
This commit is contained in:
@@ -293,6 +293,10 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateRole(SysRoleBo bo) {
|
||||
SysRole role = MapstructUtils.convert(bo, SysRole.class);
|
||||
|
||||
if (UserConstants.ROLE_DISABLE.equals(role.getStatus()) && this.countUserRoleByRoleId(role.getRoleId()) > 0) {
|
||||
throw new ServiceException("角色已分配,不能禁用!");
|
||||
}
|
||||
// 修改角色信息
|
||||
baseMapper.updateById(role);
|
||||
// 删除角色与菜单关联
|
||||
|
Reference in New Issue
Block a user