增加手机账号密码登录,修改状态返回

This commit is contained in:
2025-08-08 09:22:53 +08:00
parent ad85efaa74
commit 411b7d69d3
3 changed files with 35 additions and 2 deletions

View File

@@ -29,6 +29,10 @@ public class UserService implements UserDetailsService {
this.redisTemplate = redisTemplate;
}
public User getUserByPhone(String phone) {
return userRepository.findUserByPhone(phone).orElseThrow(() -> new RuntimeException("User not found with phone: " + phone));
}
public User registerUser(String userId, String password) {
if (userRepository.existsByUserId(userId)) {
throw new RuntimeException("Username already exists");