id唯一性校验
This commit is contained in:
parent
c6b4dd0948
commit
31102c3b82
|
@ -52,7 +52,7 @@ public class UserService {
|
||||||
String id = user.getId();
|
String id = user.getId();
|
||||||
User user1 = userMapper.selectByPrimaryKey(id);
|
User user1 = userMapper.selectByPrimaryKey(id);
|
||||||
if (user1 != null) {
|
if (user1 != null) {
|
||||||
MSException.throwException("user_id_already_exists");
|
MSException.throwException(Translator.get("user_id_already_exists"));
|
||||||
}else{
|
}else{
|
||||||
createUser(user);
|
createUser(user);
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ public class UserService {
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MSException.throwException("password_modification_failed");
|
MSException.throwException(Translator.get("password_modification_failed"));
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue