|
@@ -7,24 +7,28 @@ import (
|
|
|
"sync"
|
|
|
)
|
|
|
|
|
|
+const (
|
|
|
+ MiniTimes = 3
|
|
|
+ MaxTimes = 7
|
|
|
+ Padding int64 = 4
|
|
|
+)
|
|
|
+
|
|
|
var (
|
|
|
- num = 6
|
|
|
slideFuncS []slide.Captcha
|
|
|
clickFuncS []click.Captcha
|
|
|
rotateFuncS []rotate.Captcha
|
|
|
- rd = RandomNumberGenerator()
|
|
|
- redisTtl = 10 * 60
|
|
|
- padding int64 = 4
|
|
|
- RedisCode = "other"
|
|
|
- SendCodeKey = "send_phone_check_%s_%s"
|
|
|
- MobileCacheKey = "mobile_captcha_%s"
|
|
|
- SendCodeTtl = 30 * 60
|
|
|
- SendCodeCacheValue = "send_phone_check_%s_%sValue"
|
|
|
- SendCodeCacheKey = "send_phone_check_%s_%sKey"
|
|
|
- SendCodeCacheTime = "send_phone_check_%s_%sTime"
|
|
|
- MoldCacheKey = "captcha_mold_%s_%s"
|
|
|
- ResCacheKey = "captcha_res_%s_%s"
|
|
|
- TimesCacheKey = "captcha_times_new_%s"
|
|
|
- CaptLockMap = map[string]*sync.Mutex{}
|
|
|
- CaptLock = &sync.Mutex{}
|
|
|
+ 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{}
|
|
|
)
|