Commit a31b5b87 by 刘红梅

图形验证码接口

parent 3be80b47
...@@ -178,17 +178,16 @@ public class LoginController { ...@@ -178,17 +178,16 @@ public class LoginController {
* 验证图片验证码 * 验证图片验证码
*/ */
@PostMapping("/verifyCaptcha") @PostMapping("/verifyCaptcha")
public ResponseEntity<Map<String, Object>> verifyCaptchaNew( public ApiResult<Map<String, Object>> verifyCaptchaNew(
@RequestParam String captchaId, @RequestBody VerifyRequest request) {
@RequestParam String inputCode) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
boolean flag = sysCaptchaService.validate(captchaId, inputCode); boolean flag = sysCaptchaService.validate(request.getCaptchaId(), request.getInputCode());
String msg = "验证成功"; String msg = "验证成功";
if (!flag) { if (!flag) {
msg = "验证失败"; msg = "验证失败";
} }
result.put("success", flag); result.put("success", flag);
result.put("message", msg); result.put("message", msg);
return ResponseEntity.ok(result); return ApiResult.successWithResult(result);
} }
} }
...@@ -5,4 +5,6 @@ import lombok.Data; ...@@ -5,4 +5,6 @@ import lombok.Data;
public class VerifyRequest { public class VerifyRequest {
private String token; private String token;
private Integer moveX; // 滑块移动的X距离 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