Commit a30bdf3c authored by 332784038@qq.com's avatar 332784038@qq.com

手机校验自定义配置正则业务修改

parent ce8a3a89
......@@ -158,7 +158,7 @@ public class PhoneUtil {
}
// 字典中获取验证规则
String rule = null;
String rule = "";
try {
List<DictDataRespDTO> dtos = DictFrameworkUtils.listDictDatasFromCache("phone_number_rule");
if (CollUtil.isNotEmpty(dtos)) {
......@@ -178,6 +178,8 @@ public class PhoneUtil {
}
if (StrUtil.isNotBlank(rule)) {
// 这里的正则前面包含了区号做唯一识别,需要先替换掉
rule = rule.replaceFirst(code, "");
log.info(String.format("获取手机号规则成功, code: %s, mobile: %s, rule: %s", code, mobile, rule));
return mobile.matches(rule);
}
......
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