实现IP黑白名单、国家|地区封禁、省份封禁

This commit is contained in:
刘祥超
2020-11-09 10:44:00 +08:00
parent 725ff1d9ef
commit e8e1d3a4bd
14 changed files with 187 additions and 22 deletions

View File

@@ -1 +1,18 @@
package models
import (
"encoding/json"
"github.com/iwind/TeaGo/logs"
)
func (this *RegionCountry) DecodeCodes() []string {
if len(this.Codes) == 0 {
return []string{}
}
result := []string{}
err := json.Unmarshal([]byte(this.Codes), &result)
if err != nil {
logs.Error(err)
}
return result
}