修复验证码校验功能

main
ylyhappy 3 years ago
parent d119b9fde0
commit 2d7c778d1f
  1. 11
      CarbonSysBE1/src/main/java/edu/ncst/carbon/config/security/filter/LoginFilter.java

@ -105,15 +105,16 @@ public class LoginFilter extends AbstractAuthenticationProcessingFilter {//OnceP
// 校验验证码
String rightCaptcha = stringRedisTemplate.opsForValue().get("captcha:" + tempToken);
String loginCaptcha = paramUserLoginVO.getLoginCaptcha();
/*
if (loginCaptcha == null || "".equals(loginCaptcha)) {
throw new CaptchaIsEmptyException(CodeMsg.CAPTCHA_IS_NOT_RIGHT.getMsg());
throw new BusinessException(CodeMsg.CAPTCHA_IS_EMPTY);
} else if (rightCaptcha == null || "".equals(rightCaptcha)) {
throw new CaptchaIsExpiredException(CodeMsg.CAPTCHA_IS_EXPIRED.getMsg());
throw new BusinessException(CodeMsg.CAPTCHA_IS_EXPIRED);
} else if (!loginCaptcha.equalsIgnoreCase(rightCaptcha)) {
throw new CaptchaIsNotRightException(CodeMsg.CAPTCHA_IS_NOT_RIGHT.getMsg());
throw new BusinessException(CodeMsg.CAPTCHA_IS_NOT_RIGHT);
}
*/
// 用户名密码登录,用户名可以是用户账号名、手机号或电子邮箱
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(paramUserLoginVO.getUsername(), paramUserLoginVO.getPassword());

Loading…
Cancel
Save