xiongzhu 4 lat temu
rodzic
commit
beccdf635b

+ 3 - 0
src/main/java/com/izouma/nineth/service/UserService.java

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