角色修改接口调整

This commit is contained in:
张松
2025-02-17 17:27:25 +08:00
parent 763faa6f84
commit 483c67dab0

View File

@@ -120,7 +120,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
throw new ApiNotPrintException("角色不存在");
}
long roleCount = queryChain().eq(SysRole::getName, roleEditDTO.getName()).count();
long roleCount = queryChain().eq(SysRole::getName, roleEditDTO.getName()).ne(SysRole::getId, roleEditDTO.getId()).count();
if (roleCount > 0) {
throw new ApiNotPrintException("此角色名称已存在");
}