mirror of
https://github.com/dromara/tianai-captcha.git
synced 2026-05-07 06:04:34 +08:00
@@ -5,7 +5,8 @@ package cloud.tianai.captcha.common.exception;
|
|||||||
* @date 2022/5/7 9:04
|
* @date 2022/5/7 9:04
|
||||||
* @Description 图片验证码异常
|
* @Description 图片验证码异常
|
||||||
*/
|
*/
|
||||||
public class ImageCaptchaException extends RuntimeException{
|
public class ImageCaptchaException extends RuntimeException {
|
||||||
|
|
||||||
public ImageCaptchaException() {
|
public ImageCaptchaException() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,4 +25,5 @@ public class ImageCaptchaException extends RuntimeException{
|
|||||||
public ImageCaptchaException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
|
public ImageCaptchaException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
|
||||||
super(message, cause, enableSuppression, writableStackTrace);
|
super(message, cause, enableSuppression, writableStackTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import java.io.InputStream;
|
|||||||
* @Description 抽象的ResourceProvider
|
* @Description 抽象的ResourceProvider
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractResourceProvider implements ResourceProvider {
|
public abstract class AbstractResourceProvider implements ResourceProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputStream getResourceInputStream(Resource data) {
|
public InputStream getResourceInputStream(Resource data) {
|
||||||
InputStream resourceInputStream = doGetResourceInputStream(data);
|
InputStream resourceInputStream = doGetResourceInputStream(data);
|
||||||
@@ -26,4 +27,5 @@ public abstract class AbstractResourceProvider implements ResourceProvider {
|
|||||||
* @return InputStream
|
* @return InputStream
|
||||||
*/
|
*/
|
||||||
public abstract InputStream doGetResourceInputStream(Resource data);
|
public abstract InputStream doGetResourceInputStream(Resource data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import java.util.concurrent.ThreadLocalRandom;
|
|||||||
* @Description 默认的资源存储
|
* @Description 默认的资源存储
|
||||||
*/
|
*/
|
||||||
public class LocalMemoryResourceStore implements ResourceStore {
|
public class LocalMemoryResourceStore implements ResourceStore {
|
||||||
|
|
||||||
private static final String TYPE_TAG_SPLIT_FLAG = "|";
|
private static final String TYPE_TAG_SPLIT_FLAG = "|";
|
||||||
|
|
||||||
/** 用于检索 type和tag. */
|
/** 用于检索 type和tag. */
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import java.util.Map;
|
|||||||
* @Description 基本的行为轨迹校验
|
* @Description 基本的行为轨迹校验
|
||||||
*/
|
*/
|
||||||
public class BasicCaptchaTrackValidator extends SimpleImageCaptchaValidator {
|
public class BasicCaptchaTrackValidator extends SimpleImageCaptchaValidator {
|
||||||
|
|
||||||
public static final CodeDefinition DEFINITION = new CodeDefinition(50001, "basic check fail");
|
public static final CodeDefinition DEFINITION = new CodeDefinition(50001, "basic check fail");
|
||||||
|
|
||||||
public BasicCaptchaTrackValidator() {
|
public BasicCaptchaTrackValidator() {
|
||||||
|
|||||||
Reference in New Issue
Block a user