|
@@ -17,14 +17,6 @@ var (
|
|
smsPhoneKey = "sms_phone_%s_%s"
|
|
smsPhoneKey = "sms_phone_%s_%s"
|
|
smsCacheCode = "other"
|
|
smsCacheCode = "other"
|
|
smsLock = &sync.Mutex{}
|
|
smsLock = &sync.Mutex{}
|
|
- smsIpMap = map[string]bool{
|
|
|
|
- "10": true,
|
|
|
|
- "172": true,
|
|
|
|
- "192": true,
|
|
|
|
- "127": true,
|
|
|
|
- "169": true,
|
|
|
|
- "100": true,
|
|
|
|
- }
|
|
|
|
)
|
|
)
|
|
|
|
|
|
func SmsStrategy(keys []string) (abnormalKey []string) {
|
|
func SmsStrategy(keys []string) (abnormalKey []string) {
|
|
@@ -55,7 +47,7 @@ func Verify(reqData *ReqData) bool {
|
|
if ips := strings.Split(reqData.IP, ","); len(ips) > 0 {
|
|
if ips := strings.Split(reqData.IP, ","); len(ips) > 0 {
|
|
for _, ip := range ips {
|
|
for _, ip := range ips {
|
|
ipHead := strings.Split(ip, ".")[0]
|
|
ipHead := strings.Split(ip, ".")[0]
|
|
- if smsIpMap[ipHead] {
|
|
|
|
|
|
+ if config.SmsIpMap[ipHead] {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
keys = append(keys, fmt.Sprintf(smsIpKey, "%s", ip))
|
|
keys = append(keys, fmt.Sprintf(smsIpKey, "%s", ip))
|