增加手机账号密码登录,修改状态返回
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user