手机号授权:获取申请记录增加区号过滤

This commit is contained in:
lzm
2022-11-30 15:35:23 +08:00
committed by yeungchihang
parent 0e50bc141a
commit 815b185cef

View File

@@ -95,6 +95,13 @@ public class PhoneAuthApplyRecordServiceImpl extends ServiceImpl<PhoneAuthApplyR
}
public PhoneAuthApplyRecord getAuthApplyRecord(String phone, String phoneAreaCode) {
if (StringUtils.isEmpty(phone) || StringUtils.isEmpty(phoneAreaCode)) {
return null;
}
if (phone.startsWith(phoneAreaCode)) {
phone = phone.replaceFirst(phoneAreaCode,"");
}
QueryWrapper<PhoneAuthApplyRecord> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(PhoneAuthApplyRecord::getPhone,phone).eq(PhoneAuthApplyRecord::getAuthCode,phoneAreaCode);
return this.getOne(queryWrapper,false);