public abstract class AbstractCaptchaService extends Object implements CaptchaService
| 限定符和类型 | 字段和说明 |
|---|---|
protected static String |
cacheType |
protected static Boolean |
captchaAesStatus |
protected static int |
captchaInterferenceOptions |
protected Font |
clickWordFont |
protected static String |
clickWordFontStr |
protected static Long |
EXPIRESIN_SECONDS |
protected static Long |
EXPIRESIN_THREE |
protected static int |
HAN_ZI_SIZE |
protected static int |
HAN_ZI_SIZE_HALF |
protected static String |
IMAGE_TYPE_PNG |
protected org.slf4j.Logger |
logger |
protected static String |
REDIS_CAPTCHA_KEY |
protected static String |
REDIS_SECOND_CAPTCHA_KEY |
protected static String |
slipOffset |
protected static String |
waterMark |
protected Font |
waterMarkFont |
protected static String |
waterMarkFontStr |
| 构造器和说明 |
|---|
AbstractCaptchaService() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
afterValidateFail(CaptchaVO data) |
static boolean |
base64StrToImage(String imgStr,
String path) |
ResponseModel |
check(CaptchaVO captchaVO)
核对验证码(前端)
|
static String |
decrypt(String point,
String key)
解密前端坐标aes加密
|
void |
destroy(Properties config)
历史资源清除(过期的图片文件,生成的临时图片...)
|
ResponseModel |
get(CaptchaVO captchaVO)
获取验证码
|
protected CaptchaCacheService |
getCacheService(String cacheType) |
protected static int |
getEnOrChLength(String s) |
protected String |
getValidateClientId(CaptchaVO req) |
void |
init(Properties config)
配置初始化
|
protected boolean |
validatedReq(ResponseModel resp) |
ResponseModel |
verification(CaptchaVO captchaVO)
二次校验验证码(后端)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcaptchaTypeprotected org.slf4j.Logger logger
protected static int HAN_ZI_SIZE
protected static int HAN_ZI_SIZE_HALF
protected static String REDIS_CAPTCHA_KEY
protected static String REDIS_SECOND_CAPTCHA_KEY
protected static Long EXPIRESIN_SECONDS
protected static Long EXPIRESIN_THREE
protected static String waterMark
protected static String waterMarkFontStr
protected Font waterMarkFont
protected static String slipOffset
protected static Boolean captchaAesStatus
protected static String clickWordFontStr
protected Font clickWordFont
protected static String cacheType
protected static int captchaInterferenceOptions
public void init(Properties config)
CaptchaServiceinit 在接口中 CaptchaServiceprotected CaptchaCacheService getCacheService(String cacheType)
public void destroy(Properties config)
CaptchaServicedestroy 在接口中 CaptchaServiceconfig - 配置项 控制资源清理的粒度public ResponseModel get(CaptchaVO captchaVO)
CaptchaServiceget 在接口中 CaptchaServicepublic ResponseModel check(CaptchaVO captchaVO)
CaptchaServicecheck 在接口中 CaptchaServicepublic ResponseModel verification(CaptchaVO captchaVO)
CaptchaServiceverification 在接口中 CaptchaServiceprotected boolean validatedReq(ResponseModel resp)
protected void afterValidateFail(CaptchaVO data)
public static String decrypt(String point, String key) throws Exception
point - Exceptionprotected static int getEnOrChLength(String s)
Copyright © 2021. All rights reserved.