Merge branch 'master' of https://gitea.zianxin.com/zax/biz-api-cloud-zax
This commit is contained in:
commit
195756e80a
24 files changed
+1701
-13
No files matched your search
+4
-3
@@ -5,7 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 姓名/昵称:支持中文,或英文(单词间可空格,如 John Smith)
|
||||
* 姓名/昵称:支持中文、英文、数字(单词间可空格,如 John Smith、张三1)
|
||||
*/
|
||||
public final class PersonNameUtils {
|
||||
|
||||
@@ -21,8 +21,9 @@ public final class PersonNameUtils {
|
||||
|
||||
private static final int MAX_LEN = 32;
|
||||
|
||||
/** 中文 / 英文 / 数字,单词间允许空格 */
|
||||
private static final Pattern PERSON_NAME_PATTERN = Pattern.compile(
|
||||
"^(?:[\\u4E00-\\u9FA5]{1,32}|[A-Za-z]+(?:\\s[A-Za-z]+){0,8}|[\\u4E00-\\u9FA5A-Za-z]+(?:\\s[\\u4E00-\\u9FA5A-Za-z]+){0,8})$");
|
||||
"^[\\u4E00-\\u9FA5A-Za-z0-9]+(?:\\s[\\u4E00-\\u9FA5A-Za-z0-9]+){0,8}$");
|
||||
|
||||
private PersonNameUtils() {
|
||||
}
|
||||
@@ -72,7 +73,7 @@ public final class PersonNameUtils {
|
||||
if (CODE_NAME_EMPTY.equals(code) || CODE_NICKNAME_EMPTY.equals(code)) {
|
||||
return fieldLabel + "不能为空";
|
||||
}
|
||||
return fieldLabel + "仅支持中文,或英文(单词间可用空格,如 John Smith)";
|
||||
return fieldLabel + "仅支持中文、英文、数字(单词间可用空格)";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user