修改用户名正则
This commit is contained in:
parent
6026def180
commit
a9af60de1e
@ -78,7 +78,7 @@ public class RegexUtil {
|
|||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
*/
|
*/
|
||||||
private static final Pattern PATTERN_USERNAME = Pattern.compile("^[a-zA-Z0-9_\\s]+$");
|
private static final Pattern PATTERN_USERNAME = Pattern.compile("^[a-zA-Z0-9\\-\\_\\!\\@\\#\\%\\.]+$");
|
||||||
/**
|
/**
|
||||||
* 字母
|
* 字母
|
||||||
*/
|
*/
|
||||||
|
@ -213,7 +213,7 @@ public class ApiParamsAspect {
|
|||||||
}
|
}
|
||||||
if (StringUtils.equals("username", verifyType)) {
|
if (StringUtils.equals("username", verifyType)) {
|
||||||
if (!RegexUtil.isUsername(value)) {
|
if (!RegexUtil.isUsername(value)) {
|
||||||
throw new ParamsException(String.format("%s格式只能是字母、数字和下划线", name));
|
throw new ParamsException(String.format("%s格式只能包含字母、数字、-_!@#%.", name));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (StringUtils.equals("phone", verifyType)) {
|
} else if (StringUtils.equals("phone", verifyType)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user