|
|
@ -50,7 +50,8 @@ public class RoleServiceImpl implements RoleService { |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public Result addRole(RoleVo roleVo) { |
|
|
|
//校验角色 |
|
|
|
roleVo.setRoleName(roleVo.getRoleName().trim()); |
|
|
|
// 对角色名进行去空格处理后判断是否为空 |
|
|
|
if (roleVo.getRoleName() == null || roleVo.getRoleName().isEmpty()) { |
|
|
|
return Result.error("角色名为空"); |
|
|
|
} |
|
|
@ -107,7 +108,8 @@ public class RoleServiceImpl implements RoleService { |
|
|
|
@Transactional |
|
|
|
public Result addRole2(RoleVo roleVo) { |
|
|
|
//校验角色 |
|
|
|
if (roleVo.getRoleName() == null || roleVo.getRoleName().isEmpty()) { |
|
|
|
// 对角色名进行去空格处理后判断是否为空 |
|
|
|
if (roleVo.getRoleName() == null || roleVo.getRoleName().trim().isEmpty()) { |
|
|
|
return Result.error("角色名为空"); |
|
|
|
} |
|
|
|
// 新增校验:角色名长度需在 2 - 20 之间 |
|
|
|