commit
5800ac6b9e
|
@ -53,7 +53,7 @@ public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object>
|
||||||
{
|
{
|
||||||
String rspStr = resolveBodyFromRequest(request);
|
String rspStr = resolveBodyFromRequest(request);
|
||||||
JSONObject obj = JSONObject.parseObject(rspStr);
|
JSONObject obj = JSONObject.parseObject(rspStr);
|
||||||
validateCodeService.checkCapcha(obj.getString(CODE), obj.getString(UUID));
|
validateCodeService.checkCaptcha(obj.getString(CODE), obj.getString(UUID));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class ValidateCodeHandler implements HandlerFunction<ServerResponse>
|
||||||
AjaxResult ajax;
|
AjaxResult ajax;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ajax = validateCodeService.createCapcha();
|
ajax = validateCodeService.createCaptcha();
|
||||||
}
|
}
|
||||||
catch (CaptchaException | IOException e)
|
catch (CaptchaException | IOException e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,10 +14,10 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class ValidateCodeServiceImpl implements ValidateCodeService
|
||||||
* 生成验证码
|
* 生成验证码
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult createCapcha() throws IOException, CaptchaException
|
public AjaxResult createCaptcha() throws IOException, CaptchaException
|
||||||
{
|
{
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
boolean captchaOnOff = captchaProperties.getEnabled();
|
boolean captchaOnOff = captchaProperties.getEnabled();
|
||||||
|
@ -96,7 +96,7 @@ public class ValidateCodeServiceImpl implements ValidateCodeService
|
||||||
* 校验验证码
|
* 校验验证码
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void checkCapcha(String code, String uuid) throws CaptchaException
|
public void checkCaptcha(String code, String uuid) throws CaptchaException
|
||||||
{
|
{
|
||||||
if (StringUtils.isEmpty(code))
|
if (StringUtils.isEmpty(code))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue