Procházet zdrojové kódy

增加不能创建admin用户的校验

宋悦 před 8 roky
rodič
revize
f78db82fd3

+ 3 - 1
core-api/src/main/java/cn/com/qmth/examcloud/service/core/service/UserService.java

@@ -308,7 +308,9 @@ public class UserService {
 		User old = userRepo.findByRootOrgIdAndLoginName(rootOrgId,loginName);
 		if(old!=null){
 			throw new RuntimeException("用户名已存在");
-		}
+		}else if("admin".equalsIgnoreCase(loginName)){
+		    throw new RuntimeException("不能创建admin用户");
+        }
 	}
 
 	public User update(Long id, User user) {