12345678910111213141516171819202122232425262728293031323334 |
- package captcha
- import (
- "github.com/wenlng/go-captcha/v2/click"
- "github.com/wenlng/go-captcha/v2/rotate"
- "github.com/wenlng/go-captcha/v2/slide"
- "sync"
- )
- const (
- MiniTimes = 3
- MaxTimes = 7
- Padding int64 = 4
- )
- var (
- slideFuncS []slide.Captcha
- clickFuncS []click.Captcha
- rotateFuncS []rotate.Captcha
- rd = RandomNumberGenerator()
- redisTtl = 10 * 60
- SendCodeTtl = 30 * 60
- RedisCode = "other"
- MoldCacheKey = "captcha_mold_%s_%s"
- ResCacheKey = "captcha_res_%s_%s"
- SendCodeKey = "send_phone_check_%s_%s"
- MobileCacheKey = "mobile_captcha_%s"
- SendCodeCacheValue = "send_phone_check_%s_%sValue"
- SendCodeCacheKey = "send_phone_check_%s_%sKey"
- SendCodeCacheTime = "send_phone_check_%s_%sTime"
- TimesCacheKey = "captcha_times_new_%s"
- CaptLockMap = map[string]*sync.Mutex{}
- CaptLock = &sync.Mutex{}
- )
|