访问日志增加区域和ISP信息

This commit is contained in:
GoEdgeLab
2020-11-05 11:51:37 +08:00
parent 6ef0d0465b
commit 2220d18538
18 changed files with 433 additions and 0 deletions

View File

@@ -39,6 +39,22 @@ func (this *IP2RegionLibrary) Lookup(ip string) (*Result, error) {
return nil, err
}
if info.Country == "0" {
info.Country = ""
}
if info.Region == "0" {
info.Region = ""
}
if info.Province == "0" {
info.Province = ""
}
if info.City == "0" {
info.City = ""
}
if info.ISP == "0" {
info.ISP = ""
}
return &Result{
CityId: info.CityId,
Country: info.Country,