1.登录验证码可选
This commit is contained in:
@@ -87,10 +87,10 @@ public class AuthorizationController {
|
|||||||
String code = (String) redisUtils.get(authUser.getUuid());
|
String code = (String) redisUtils.get(authUser.getUuid());
|
||||||
// 清除验证码
|
// 清除验证码
|
||||||
redisUtils.del(authUser.getUuid());
|
redisUtils.del(authUser.getUuid());
|
||||||
if (StringUtils.isBlank(code)) {
|
if (authUser.isChecked() && StringUtils.isBlank(code)) {
|
||||||
throw new BadRequestException("验证码不存在或已过期");
|
throw new BadRequestException("验证码不存在或已过期");
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(authUser.getCode()) || !authUser.getCode().equalsIgnoreCase(code)) {
|
if (authUser.isChecked() && StringUtils.isBlank(authUser.getCode()) || authUser.isChecked() && !authUser.getCode().equalsIgnoreCase(code)) {
|
||||||
throw new BadRequestException("验证码错误");
|
throw new BadRequestException("验证码错误");
|
||||||
}
|
}
|
||||||
//生成token
|
//生成token
|
||||||
|
|||||||
@@ -36,4 +36,6 @@ public class AuthUserDto {
|
|||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private String uuid = "";
|
private String uuid = "";
|
||||||
|
|
||||||
|
private boolean checked = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user