|
|
@@ -50,9 +50,9 @@ public class UserService {
|
|
|
public User register(String phone, String password, Identity identity) {
|
|
|
User user = userRepo.findByPhoneAndIdentity(phone, identity);
|
|
|
if (ObjectUtil.isNull(user)) {
|
|
|
- if (RIDER.equals(identity)) {
|
|
|
+/* if (RIDER.equals(identity)) {
|
|
|
throw new BusinessException("未注册");
|
|
|
- }
|
|
|
+ }*/
|
|
|
user = User.builder()
|
|
|
.username(phone)
|
|
|
.nickname(user.getDefaultUsername(phone))
|
|
|
@@ -72,6 +72,12 @@ public class UserService {
|
|
|
if (user.getBlacklist()) {
|
|
|
throw new BusinessException("被拉入黑名单!");
|
|
|
}
|
|
|
+ if (RIDER.equals(identity)) {
|
|
|
+ boolean matches = new BCryptPasswordEncoder().matches(password, user.getPassword());
|
|
|
+ if (!matches) {
|
|
|
+ throw new BusinessException("密码不正确");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return user;
|
|
|
}
|