mirror of
https://github.com/xiaoqidun/qqwry.git
synced 2023-06-27 14:38:22 +08:00
feat(查询优化): 查询优化
This commit is contained in:
parent
0865c44d5e
commit
ccbae8531d
9
qqwry.go
9
qqwry.go
@ -139,9 +139,16 @@ func QueryIP(queryIp string) (city string, area string, err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if city != "" {
|
||||||
city = strings.TrimSpace(gb18030Decode([]byte(city)))
|
city = strings.TrimSpace(gb18030Decode([]byte(city)))
|
||||||
|
}
|
||||||
|
if area != "" {
|
||||||
|
if strings.Contains(area, "CZ88.NET") {
|
||||||
|
area = ""
|
||||||
|
} else {
|
||||||
area = strings.TrimSpace(gb18030Decode([]byte(area)))
|
area = strings.TrimSpace(gb18030Decode([]byte(area)))
|
||||||
area = strings.ReplaceAll(area, "CZ88.NET", "")
|
}
|
||||||
|
}
|
||||||
ipCache.Store(queryIp, cache{City: city, Area: area})
|
ipCache.Store(queryIp, cache{City: city, Area: area})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user