Browse Source

feat(查询优化): 查询优化

main
xiaoqidun 4 weeks ago
parent
commit
ccbae8531d
  1. 13
      qqwry.go

13
qqwry.go

@ -139,9 +139,16 @@ func QueryIP(queryIp string) (city string, area string, err error) {
}
}
}
city = strings.TrimSpace(gb18030Decode([]byte(city)))
area = strings.TrimSpace(gb18030Decode([]byte(area)))
area = strings.ReplaceAll(area, "CZ88.NET", "")
if city != "" {
city = strings.TrimSpace(gb18030Decode([]byte(city)))
}
if area != "" {
if strings.Contains(area, "CZ88.NET") {
area = ""
} else {
area = strings.TrimSpace(gb18030Decode([]byte(area)))
}
}
ipCache.Store(queryIp, cache{City: city, Area: area})
return
}

Loading…
Cancel
Save