|
|
@@ -121,6 +121,9 @@ public class UserService {
|
|
|
public User loginByPhonePwd(String phone, String password) {
|
|
|
User user = userRepo.findByPhoneAndDelFalse(phone).orElseThrow(new BusinessException("账号或密码错误"));
|
|
|
|
|
|
+ if (StringUtils.isEmpty(user.getPassword())) {
|
|
|
+ throw new BusinessException("账号或密码错误");
|
|
|
+ }
|
|
|
if (StringUtils.isNoneEmpty(user.getPassword()) &&
|
|
|
new BCryptPasswordEncoder().matches(password, user.getPassword())) {
|
|
|
throw new BusinessException("账号或密码错误");
|