mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-08 10:14:03 +08:00
登录接口增加图形验证码校验
This commit is contained in:
parent
67c0dc7ae3
commit
fe88aca839
@ -14,6 +14,7 @@ import xyz.playedu.api.event.UserLoginEvent;
|
||||
import xyz.playedu.api.event.UserLogoutEvent;
|
||||
import xyz.playedu.api.exception.JwtLogoutException;
|
||||
import xyz.playedu.api.exception.LimitException;
|
||||
import xyz.playedu.api.middleware.ImageCaptchaCheckMiddleware;
|
||||
import xyz.playedu.api.request.frontend.LoginPasswordRequest;
|
||||
import xyz.playedu.api.service.JWTService;
|
||||
import xyz.playedu.api.service.UserService;
|
||||
@ -43,6 +44,7 @@ public class LoginController {
|
||||
private ApplicationContext ctx;
|
||||
|
||||
@PostMapping("/password")
|
||||
@ImageCaptchaCheckMiddleware
|
||||
public JsonResponse password(@RequestBody @Validated LoginPasswordRequest req) throws LimitException {
|
||||
String email = req.getEmail();
|
||||
|
||||
|
@ -3,13 +3,14 @@ package xyz.playedu.api.request.frontend;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import xyz.playedu.api.request.backend.types.ImageCaptchaRequestInterface;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
* @create 2023/3/10 13:13
|
||||
*/
|
||||
@Data
|
||||
public class LoginPasswordRequest {
|
||||
public class LoginPasswordRequest implements ImageCaptchaRequestInterface {
|
||||
|
||||
@NotBlank(message = "请输入邮箱")
|
||||
private String email;
|
||||
@ -23,6 +24,6 @@ public class LoginPasswordRequest {
|
||||
|
||||
@NotBlank(message = "请输入验证码")
|
||||
@JsonProperty("captcha_val")
|
||||
private String captchaVal;
|
||||
private String captchaValue;
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user