代码提交

This commit is contained in:
glj 2023-04-11 17:57:43 +08:00
parent 6c7048cb95
commit 54be606916
1 changed files with 2 additions and 2 deletions

View File

@ -28,12 +28,12 @@ public class CaptchaController extends BladeController {
@PostMapping("/validate") @PostMapping("/validate")
@ApiOperation(value = "验证码校验", notes = "传入需要校验的验证码以及缓存Key") @ApiOperation(value = "验证码校验", notes = "传入需要校验的验证码以及缓存Key")
public R<String> validDefaultTime(@RequestParam String code, @RequestParam String key) { public R validDefaultTime(@RequestParam String code, @RequestParam String key) {
// 获取验证码 // 获取验证码
String redisCode = bladeRedis.get(CacheNames.CAPTCHA_KEY + key); String redisCode = bladeRedis.get(CacheNames.CAPTCHA_KEY + key);
// 判断验证码 // 判断验证码
if (code == null || !StringUtil.equalsIgnoreCase(redisCode, code)) { if (code == null || !StringUtil.equalsIgnoreCase(redisCode, code)) {
return R.fail(1404, "Verification code error"); return R.data(1404, "Verification code error");
} }
return R.success("OK"); return R.success("OK");
} }