服务日志:增加区域信息

This commit is contained in:
GoEdgeLab
2021-01-13 17:00:09 +08:00
parent d27db90ea2
commit d64a66c48d
11 changed files with 131 additions and 48 deletions

View File

@@ -78,13 +78,13 @@ func checkIPWithoutCache(config *systemconfigs.SecurityConfig, ipAddr string) bo
logs.Println("[USER_MUST_AUTH][ERROR]" + err.Error())
return false
}
if resp.Region == nil {
if resp.IpRegion == nil {
return true
}
if len(config.AllowCountryIds) > 0 && !lists.ContainsInt64(config.AllowCountryIds, resp.Region.CountryId) {
if len(config.AllowCountryIds) > 0 && !lists.ContainsInt64(config.AllowCountryIds, resp.IpRegion.CountryId) {
return false
}
if len(config.AllowProvinceIds) > 0 && !lists.ContainsInt64(config.AllowProvinceIds, resp.Region.ProvinceId) {
if len(config.AllowProvinceIds) > 0 && !lists.ContainsInt64(config.AllowProvinceIds, resp.IpRegion.ProvinceId) {
return false
}
}