xiatian 2 anos atrás
pai
commit
a8dd1200ef

+ 4 - 1
src/main/java/cn/com/qmth/mps/service/impl/UserServiceImpl.java

@@ -85,7 +85,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
 			throw new StatusException("角色不能为空");
 		}
 		if (domain.getRole().equals(Role.SUPER_ADMIN)) {
-			throw new StatusException("不能新增编辑超管");
+			throw new StatusException("不能新增超管");
 		}
 		if (!domain.getRole().equals(Role.SECTION_LEADER) && CollectionUtils.isNotEmpty(domain.getCourse())) {
 			throw new StatusException("只有科组长可关联科目");
@@ -96,6 +96,9 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
 			if (ue == null) {
 				throw new StatusException("未找到用户");
 			}
+			if (ue.getRoleId().equals(Role.SUPER_ADMIN.getId())) {
+				throw new StatusException("不能编辑超管");
+			}
 		} else {
 			if (getByLoginName(domain.getLoginName()) != null) {
 				throw new StatusException("登录名已存在");