Commit a31b5b87 by 刘红梅

图形验证码接口

parent 3be80b47
......@@ -178,17 +178,16 @@ public class LoginController {
* 验证图片验证码
*/
@PostMapping("/verifyCaptcha")
public ResponseEntity<Map<String, Object>> verifyCaptchaNew(
@RequestParam String captchaId,
@RequestParam String inputCode) {
public ApiResult<Map<String, Object>> verifyCaptchaNew(
@RequestBody VerifyRequest request) {
Map<String, Object> result = new HashMap<>();
boolean flag = sysCaptchaService.validate(captchaId, inputCode);
boolean flag = sysCaptchaService.validate(request.getCaptchaId(), request.getInputCode());
String msg = "验证成功";
if (!flag) {
msg = "验证失败";
}
result.put("success", flag);
result.put("message", msg);
return ResponseEntity.ok(result);
return ApiResult.successWithResult(result);
}
}
......@@ -5,4 +5,6 @@ import lombok.Data;
public class VerifyRequest {
private String token;
private Integer moveX; // 滑块移动的X距离
private String captchaId;
private String inputCode;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment