mirror of
https://github.com/BgaSol/sol-cloud
synced 2026-05-05 23:58:33 +00:00
refactor(web system): Modify permissions and menu query methods in role services
-Changing the query method for permissions and menus from cacheSearch to findById - This change can improve code readability and consistency, as the findById method is typically used to directly query entities based on their IDs
This commit is contained in:
parent
815e2e7112
commit
a3ed646df5
1 changed files with 2 additions and 2 deletions
|
|
@ -128,7 +128,7 @@ public class RoleService extends BasePoiService<RoleEntity,
|
|||
// 关联ID有效性校验(可选,存在即通过)
|
||||
if (permissionIds != null) {
|
||||
for (String pid : permissionIds) {
|
||||
PermissionEntity p = permissionService.cacheSearch(pid);
|
||||
PermissionEntity p = permissionService.findById(pid);
|
||||
if (p == null) {
|
||||
return addErrorAndFail(errors, rowIndex, "权限ID不存在: " + pid);
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ public class RoleService extends BasePoiService<RoleEntity,
|
|||
}
|
||||
if (menuIds != null) {
|
||||
for (String mid : menuIds) {
|
||||
MenuEntity m = menuService.cacheSearch(mid);
|
||||
MenuEntity m = menuService.findById(mid);
|
||||
if (m == null) {
|
||||
return addErrorAndFail(errors, rowIndex, "菜单ID不存在: " + mid);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue