类 AbstractCaptchaService

java.lang.Object
com.xingyuv.captcha.service.impl.AbstractCaptchaService
所有已实现的接口:
CaptchaService
直接已知子类:
BlockPuzzleCaptchaServiceImpl, ClickWordCaptchaServiceImpl, DefaultCaptchaServiceImpl, RotatePuzzleCaptchaServiceImpl

public abstract class AbstractCaptchaService extends Object implements CaptchaService
Created by raodeming on 2019/12/25.
  • 字段详细资料

    • logger

      protected org.slf4j.Logger logger
    • IMAGE_TYPE_PNG

      protected static final String IMAGE_TYPE_PNG
      另请参阅:
    • HAN_ZI_SIZE

      protected static int HAN_ZI_SIZE
    • HAN_ZI_SIZE_HALF

      protected static int HAN_ZI_SIZE_HALF
    • REDIS_CAPTCHA_KEY

      protected static String REDIS_CAPTCHA_KEY
    • REDIS_SECOND_CAPTCHA_KEY

      protected static String REDIS_SECOND_CAPTCHA_KEY
    • EXPIRESIN_SECONDS

      protected static Long EXPIRESIN_SECONDS
    • EXPIRESIN_THREE

      protected static Long EXPIRESIN_THREE
    • waterMark

      protected static String waterMark
    • waterMarkFontStr

      protected static String waterMarkFontStr
    • waterMarkFont

      protected Font waterMarkFont
      水印字体
    • slipOffset

      protected static String slipOffset
    • captchaAesStatus

      protected static Boolean captchaAesStatus
    • clickWordFontStr

      protected static String clickWordFontStr
    • clickWordFont

      protected Font clickWordFont
      点选文字字体
    • cacheType

      protected static String cacheType
    • captchaInterferenceOptions

      protected static int captchaInterferenceOptions
    • limitHandler

      private static FrequencyLimitHandler limitHandler
  • 构造器详细资料

    • AbstractCaptchaService

      public AbstractCaptchaService()
  • 方法详细资料

    • init

      public void init(Properties config)
      判断应用是否实现了自定义缓存,没有就使用内存
      指定者:
      init 在接口中 CaptchaService
      参数:
      config - config
    • getCacheService

      protected CaptchaCacheService getCacheService(String cacheType)
    • destroy

      public void destroy(Properties config)
      从接口复制的说明: CaptchaService
      历史资源清除(过期的图片文件,生成的临时图片...)
      指定者:
      destroy 在接口中 CaptchaService
      参数:
      config - 配置项 控制资源清理的粒度
    • get

      public ResponseModel get(CaptchaVO captchaVO)
      从接口复制的说明: CaptchaService
      获取验证码
      指定者:
      get 在接口中 CaptchaService
      参数:
      captchaVO - captchaVO
      返回:
      ResponseModel
    • check

      public ResponseModel check(CaptchaVO captchaVO)
      从接口复制的说明: CaptchaService
      核对验证码(前端)
      指定者:
      check 在接口中 CaptchaService
      参数:
      captchaVO - captchaVO
      返回:
      ResponseModel
    • verification

      public ResponseModel verification(CaptchaVO captchaVO)
      从接口复制的说明: CaptchaService
      二次校验验证码(后端)
      指定者:
      verification 在接口中 CaptchaService
      参数:
      captchaVO - captchaVO
      返回:
      ResponseModel
    • validatedReq

      protected boolean validatedReq(ResponseModel resp)
    • getValidateClientId

      protected String getValidateClientId(CaptchaVO req)
    • afterValidateFail

      protected void afterValidateFail(CaptchaVO data)
    • loadWaterMarkFont

      private void loadWaterMarkFont()
      加载resources下的font字体,add by lide1202@hotmail.com 部署在linux中,如果没有安装中文字段,水印和点选文字,中文无法显示, 通过加载resources下的font字体解决,无需在linux中安装字体
    • base64StrToImage

      public static boolean base64StrToImage(String imgStr, String path)
    • decrypt

      public static String decrypt(String point, String key) throws Exception
      解密前端坐标aes加密
      参数:
      point - 前端坐标
      key - key
      返回:
      前端坐标aes加密
      抛出:
      Exception - E
    • getEnOrChLength

      protected static int getEnOrChLength(String s)