修改错误单词拼写,由**Capcha**改为**Captcha**
| | |
| | |
|
| | | /**
|
| | | * 验证码过滤器
|
| | | * |
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @Component
|
| | |
| | | {
|
| | | String rspStr = resolveBodyFromRequest(request);
|
| | | JSONObject obj = JSONObject.parseObject(rspStr);
|
| | | validateCodeService.checkCapcha(obj.getString(CODE), obj.getString(UUID));
|
| | | validateCodeService.checkCaptcha(obj.getString(CODE), obj.getString(UUID));
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | |
| | |
|
| | | /**
|
| | | * 验证码获取
|
| | | * |
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @Component
|
| | |
| | | AjaxResult ajax;
|
| | | try
|
| | | {
|
| | | ajax = validateCodeService.createCapcha();
|
| | | ajax = validateCodeService.createCaptcha();
|
| | | }
|
| | | catch (CaptchaException | IOException e)
|
| | | {
|
| | |
| | | }
|
| | | return ServerResponse.status(HttpStatus.OK).body(BodyInserters.fromValue(ajax));
|
| | | }
|
| | | } |
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 验证码处理
|
| | | * |
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | public interface ValidateCodeService
|
| | |
| | | /**
|
| | | * 生成验证码
|
| | | */
|
| | | public AjaxResult createCapcha() throws IOException, CaptchaException;
|
| | | public AjaxResult createCaptcha() throws IOException, CaptchaException;
|
| | |
|
| | | /**
|
| | | * 校验验证码
|
| | | */
|
| | | public void checkCapcha(String key, String value) throws CaptchaException;
|
| | | public void checkCaptcha(String key, String value) throws CaptchaException;
|
| | | }
|
| | |
| | | * 生成验证码
|
| | | */
|
| | | @Override
|
| | | public AjaxResult createCapcha() throws IOException, CaptchaException
|
| | | public AjaxResult createCaptcha() throws IOException, CaptchaException
|
| | | {
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | boolean captchaOnOff = captchaProperties.getEnabled();
|
| | |
| | | * 校验验证码
|
| | | */
|
| | | @Override
|
| | | public void checkCapcha(String code, String uuid) throws CaptchaException
|
| | | public void checkCaptcha(String code, String uuid) throws CaptchaException
|
| | | {
|
| | | if (StringUtils.isEmpty(code))
|
| | | {
|