Compare commits
2 Commits
7f8a37803a
...
3bb5397c49
Author | SHA1 | Date | |
---|---|---|---|
3bb5397c49 | |||
b69983077a |
@@ -222,6 +222,10 @@
|
||||
{
|
||||
"code": 4040201,
|
||||
"description": "不支持的 PrincipalType"
|
||||
},
|
||||
{
|
||||
"code": 4040209,
|
||||
"description": "不支持的菜单类型"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@@ -36,7 +36,7 @@ class LoginCommandValidator extends BaseValidator<LoginCommand> {
|
||||
private LoginCommandValidator() {
|
||||
ruleForString(LoginCommand::getAccount)
|
||||
.notNull("邮箱地址不能为空")
|
||||
.matchesOr(new Pattern[] { PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE },
|
||||
.matchesOne(new Pattern[] { PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE },
|
||||
value -> new RuntimeException('"' + value + "\" 不是邮箱地址或手机号"));
|
||||
ruleForString(LoginCommand::getPwd)
|
||||
.notNull("密码不能为空")
|
||||
|
@@ -7,11 +7,13 @@ public class UnsupportedMenuTypeException extends InvalidInputException {
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -769169844015637730L;
|
||||
|
||||
public static final String ERROR_CODE = "4040209";
|
||||
|
||||
public UnsupportedMenuTypeException() {
|
||||
this("不支持的菜单类型");
|
||||
}
|
||||
|
||||
public UnsupportedMenuTypeException(String message) {
|
||||
super(message);
|
||||
super(ERROR_CODE, message);
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ public class LoginByOtpCommandValidator extends BaseValidator<LoginByOtpCommand>
|
||||
ruleForString(LoginByOtpCommand::getPrincipal)
|
||||
.notNull("输入邮箱地址或手机号")
|
||||
.notEmpty("输入邮箱地址或手机号")
|
||||
.matchesOr(List.of(PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE), "输入用户名、邮箱地址或手机号");
|
||||
.matchesOne(List.of(PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE), "输入用户名、邮箱地址或手机号");
|
||||
ruleForString(LoginByOtpCommand::getOtp)
|
||||
.notNull("验证码不能为空")
|
||||
.notEmpty("验证码不能为空")
|
||||
|
@@ -15,7 +15,7 @@ public class LoginByPasswordCommandValidator extends BaseValidator<LoginByPasswo
|
||||
ruleForString(LoginByPasswordCommand::getPrincipal)
|
||||
.notNull("输入用户名、邮箱地址或手机号")
|
||||
.notEmpty("输入用户名、邮箱地址或手机号")
|
||||
.matchesOr(List.of(PatternConsts.USERNAME, PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE),
|
||||
.matchesOne(List.of(PatternConsts.USERNAME, PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE),
|
||||
"输入用户名、邮箱地址或手机号");
|
||||
ruleForString(LoginByPasswordCommand::getPassword)
|
||||
.notNull("密码不能为空")
|
||||
|
Reference in New Issue
Block a user