public abstract class AbstractCaptchaService extends Object implements CaptchaService
| Modifier and Type | Field and Description |
|---|---|
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 |
| Constructor and Description |
|---|
AbstractCaptchaService() |
| Modifier and Type | Method and Description |
|---|---|
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 final String IMAGE_TYPE_PNG
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 in interface CaptchaServiceprotected CaptchaCacheService getCacheService(String cacheType)
public void destroy(Properties config)
CaptchaServicedestroy in interface CaptchaServiceconfig - 配置项 控制资源清理的粒度public ResponseModel get(CaptchaVO captchaVO)
CaptchaServiceget in interface CaptchaServicepublic ResponseModel check(CaptchaVO captchaVO)
CaptchaServicecheck in interface CaptchaServicepublic ResponseModel verification(CaptchaVO captchaVO)
CaptchaServiceverification in interface 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 © 2025. All rights reserved.