mirror of https://gitee.com/maxjhandsome/pig
修改验证码没有与用户输入进行校验
This commit is contained in:
parent
23cb3b777d
commit
492610fe2e
|
@ -118,9 +118,6 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory<Obje
|
|||
}
|
||||
|
||||
String key = CacheConstants.DEFAULT_CODE_KEY + randomStr;
|
||||
if (Boolean.FALSE.equals(redisTemplate.hasKey(key))) {
|
||||
throw new ValidateCodeException("验证码不合法");
|
||||
}
|
||||
|
||||
Object codeObj = redisTemplate.opsForValue().get(key);
|
||||
|
||||
|
@ -128,13 +125,10 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory<Obje
|
|||
throw new ValidateCodeException("验证码不合法");
|
||||
}
|
||||
|
||||
String saveCode = codeObj.toString();
|
||||
if (CharSequenceUtil.isBlank(saveCode)) {
|
||||
redisTemplate.delete(key);
|
||||
if (!code.equals(codeObj)) {
|
||||
throw new ValidateCodeException("验证码不合法");
|
||||
}
|
||||
|
||||
redisTemplate.delete(key);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue