Class VerifyCaptchaCommandHandler

java.lang.Object
com.sankcrm.erp.auth.application.authz.captcha.VerifyCaptchaCommandHandler
All Implemented Interfaces:
com.sankcrm.erp.bus.CommandHandler<Void,VerifyCaptchaCommand>

@Component @Transactional(timeout=60, rollbackFor=java.lang.Exception.class) public class VerifyCaptchaCommandHandler extends Object implements com.sankcrm.erp.bus.CommandHandler<Void,VerifyCaptchaCommand>
在登录认证前一次性验证验证码,并对验证流量执行独立限流。
  • Constructor Details

    • VerifyCaptchaCommandHandler

      public VerifyCaptchaCommandHandler()
  • Method Details

    • handle

      public Void handle(VerifyCaptchaCommand command) throws com.sankcrm.erp.common.exception.CoreException
      校验当前登录账号是否需要验证码,再按 app/type/flow 校验并一次性消费答案。
      Specified by:
      handle in interface com.sankcrm.erp.bus.CommandHandler<Void,VerifyCaptchaCommand>
      Parameters:
      command - 登录上下文及验证码答案
      Returns:
      成功消费时返回 null;当前无需验证码时亦返回 null
      Throws:
      com.sankcrm.erp.common.exception.CoreException - 答案无效、已过期、被限流或 Redis 不可用时抛出;存储异常失败关闭
    • required

      protected boolean required(App app, String authType, String account) throws com.sankcrm.erp.common.exception.CoreException
      Throws:
      com.sankcrm.erp.common.exception.CoreException