优化用户登录逻辑

This commit is contained in:
2025-08-15 09:24:01 +08:00
parent 37bf419e08
commit 8277e54662
3 changed files with 5 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ public class UserService implements UserDetailsService {
}
public User getUserByPhone(String phone) {
return userRepository.findUserByPhone(phone).orElseThrow(() -> new RuntimeException("User not found with phone: " + phone));
return userRepository.findUserByPhone(phone).orElse(null);
}
public User registerUser(String userId, String password) {