mirror of
https://github.com/xiaoqidun/qqwry.git
synced 2026-09-17 22:53:14 +08:00
feat(查询优化): 查询优化
This commit is contained in:
1 parent
0865c44d5e
commit
ccbae8531d
1 file changed
+10
-3
@@ -139,9 +139,16 @@ func QueryIP(queryIp string) (city string, area string, err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
city = strings.TrimSpace(gb18030Decode([]byte(city)))
|
if city != "" {
|
||||||
area = strings.TrimSpace(gb18030Decode([]byte(area)))
|
city = strings.TrimSpace(gb18030Decode([]byte(city)))
|
||||||
area = strings.ReplaceAll(area, "CZ88.NET", "")
|
}
|
||||||
|
if area != "" {
|
||||||
|
if strings.Contains(area, "CZ88.NET") {
|
||||||
|
area = ""
|
||||||
|
} else {
|
||||||
|
area = strings.TrimSpace(gb18030Decode([]byte(area)))
|
||||||
|
}
|
||||||
|
}
|
||||||
ipCache.Store(queryIp, cache{City: city, Area: area})
|
ipCache.Store(queryIp, cache{City: city, Area: area})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user