Commit 15d2f3ec authored by greyby's avatar greyby

不能返回空,抛异常

parent 6c5ea055
...@@ -127,20 +127,18 @@ public class UserDetailServiceImpl implements IUserDetailService { ...@@ -127,20 +127,18 @@ public class UserDetailServiceImpl implements IUserDetailService {
list.add(criteriaBuilder.equal(root.get(Constants.PHONE_NO).as(String.class), phoneNo)); list.add(criteriaBuilder.equal(root.get(Constants.PHONE_NO).as(String.class), phoneNo));
}else if (StringUtils.isNotBlank(phoneNo)) { }else if (StringUtils.isNotBlank(phoneNo)) {
if (phoneNo.length() < 9) { if (phoneNo.length() < 9) {
log.info("哪个傻逼用这么少的数字查. phoneNo:{}", phoneNo); log.error("哪个傻逼用这么少的数字查. phoneNo:{}", phoneNo);
return null; throw new RuntimeException("not_allowed");
} }
list.add(criteriaBuilder.like(root.get(Constants.PHONE_NO).as(String.class), phoneNo.concat("%")));
} }
if (StringUtils.isNotBlank(idNo)) { if (StringUtils.isNotBlank(idNo)) {
if(Objects.equals(Constants.IDNO_LENGTH, idNo.length())){ if(Objects.equals(Constants.IDNO_LENGTH, idNo.length())){
list.add(criteriaBuilder.equal(root.get("idNo").as(String.class), idNo)); list.add(criteriaBuilder.equal(root.get("idNo").as(String.class), idNo));
}else{ }else{
if (idNo.length() < 16) { if (idNo.length() < 16) {
log.info("哪个傻逼用这么少的数字查. idNo:{}", idNo); log.error("哪个傻逼用这么少的数字查. idNo:{}", idNo);
return null; throw new RuntimeException("not_allowed");
} }
list.add(criteriaBuilder.like(root.get("idNo").as(String.class), idNo.concat("%")));
} }
} }
if (StringUtils.isNotBlank(name)) { if (StringUtils.isNotBlank(name)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment