|
|
@ -48,9 +48,15 @@ public class RoleServiceImpl implements RoleService { |
|
|
|
if (roleVo.getRoleName() == null || roleVo.getRoleName().isEmpty()) { |
|
|
|
return Result.error("角色名为空"); |
|
|
|
} |
|
|
|
// 新增校验:角色名长度需在 2 - 20 之间 |
|
|
|
if (roleVo.getRoleName().length() < 2 || roleVo.getRoleName().length() > 20) { |
|
|
|
return Result.error("角色名长度需在2-20个字符之间"); |
|
|
|
} |
|
|
|
if (roleMapper.selectByRoleName(roleVo.getRoleName()) != null) { |
|
|
|
return Result.error("角色名重复"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (roleVo.getPriority() == null) { |
|
|
|
return Result.error("优先级为空"); |
|
|
|
} |
|
|
@ -62,8 +68,7 @@ public class RoleServiceImpl implements RoleService { |
|
|
|
} |
|
|
|
if (roleVo.getMarket() == null || roleVo.getMarket().isEmpty()) { |
|
|
|
return Result.error("所属市场为空"); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
if (roleVo.getFatherId() != 2) { |
|
|
|
for (Integer menuId : roleVo.getMenuIds()) { |
|
|
|
if (menuId == 9) { |
|
|
|