mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-27 01:32:03 +08:00
优化图片验证码的后端实现
This commit is contained in:
parent
b134492fa9
commit
a484cd5193
@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.framework.captcha.core.enums;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine;
|
||||||
|
import com.anji.captcha.model.vo.PointVO;
|
||||||
|
import org.redisson.api.RLock;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.redis.core.RedisKeyDefine.KeyTypeEnum.HASH;
|
||||||
|
import static cn.iocoder.yudao.framework.redis.core.RedisKeyDefine.KeyTypeEnum.STRING;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证码 Redis Key 枚举类
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
public interface CaptchaRedisKeyConstants {
|
||||||
|
|
||||||
|
RedisKeyDefine AJ_CAPTCHA_REQ_LIMIT = new RedisKeyDefine("验证码的请求限流",
|
||||||
|
"AJ.CAPTCHA.REQ.LIMIT-%s-%s",
|
||||||
|
STRING, Integer.class, Duration.ofSeconds(60)); // 例如说:验证失败 5 次,get 接口锁定
|
||||||
|
|
||||||
|
RedisKeyDefine AJ_CAPTCHA_RUNNING = new RedisKeyDefine("验证码的坐标",
|
||||||
|
"RUNNING:CAPTCHA:%s", // AbstractCaptchaService.REDIS_CAPTCHA_KEY
|
||||||
|
STRING, PointVO.class, Duration.ofSeconds(120)); // {"secretKey":"PP1w2Frr2KEejD2m","x":162,"y":5}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user