增加字段字符与数字组合校验

This commit is contained in:
WenG 2022-04-27 00:10:20 +08:00
parent 87e584a3db
commit fb5b83ffbd

View File

@ -193,8 +193,13 @@ public class BeanPropertyCheckUtil {
throw new ParamsException(String.format("%s格式非字母格式", name));
}
return;
} else if (StringUtils.equals("letterOrNumber", verifyType)) {
if (!RegexUtil.isLetterOrNumber(value)) {
throw new ParamsException(String.format("%s格式非字母与数字格式", name));
}
return;
} else if (StringUtils.equals("chinese", verifyType)) {
if (!RegexUtil.isLetter(value)) {
if (!RegexUtil.isChinese(value)) {
throw new ParamsException(String.format("%s格式非中文格式", name));
}
return;