redis更改,登录部分修改
This commit is contained in:
@@ -110,14 +110,10 @@ public class UserServiceImpl implements UserService {
|
||||
User user = userRepository.findById(resources.getId()).orElseGet(User::new);
|
||||
ValidationUtil.isNull(user.getId(), "User", "id", resources.getId());
|
||||
User user1 = userRepository.findByUsername(resources.getUsername());
|
||||
User user2 = userRepository.findByEmail(resources.getEmail());
|
||||
User user3 = userRepository.findByPhone(resources.getPhone());
|
||||
if (user1 != null && !user.getId().equals(user1.getId())) {
|
||||
throw new EntityExistException(User.class, "username", resources.getUsername());
|
||||
}
|
||||
if (user2 != null && !user.getId().equals(user2.getId())) {
|
||||
throw new EntityExistException(User.class, "email", resources.getEmail());
|
||||
}
|
||||
if (user3 != null && !user.getId().equals(user3.getId())) {
|
||||
throw new EntityExistException(User.class, "phone", resources.getPhone());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user