|
@@ -304,12 +304,14 @@ public class UserService {
|
|
return userRepo.save(user);
|
|
return userRepo.save(user);
|
|
}
|
|
}
|
|
|
|
|
|
- private void checkLoginName(Long rootOrgId,String loginName) {
|
|
|
|
- User old = userRepo.findByRootOrgIdAndLoginName(rootOrgId,loginName);
|
|
|
|
- if(old!=null){
|
|
|
|
- throw new RuntimeException("用户名已存在");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ private void checkLoginName(Long rootOrgId,String loginName) {
|
|
|
|
+ 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) {
|
|
public User update(Long id, User user) {
|
|
User old = userRepo.findOne(id);
|
|
User old = userRepo.findOne(id);
|