style: 错误信息英文返回-framework模块

This commit is contained in:
TsMask
2023-11-08 15:00:05 +08:00
parent 267a13d3d6
commit 81138b8c22
9 changed files with 28 additions and 21 deletions

View File

@@ -42,7 +42,8 @@ func init() {
func RegionSearchByIp(ip string) (string, int, int64) {
ip = ClientIP(ip)
if ip == LOCAT_HOST {
return "0|0|0|内网IP|内网IP", 0, 0
// "0|0|0|内网IP|内网IP"
return "0|0|0|Intranet IP|Intranet IP", 0, 0
}
tStart := time.Now()
region, err := searcher.SearchByStr(ip)
@@ -59,12 +60,12 @@ func RegionSearchByIp(ip string) (string, int, int64) {
func RealAddressByIp(ip string) string {
ip = ClientIP(ip)
if ip == LOCAT_HOST {
return "内网IP"
return "Intranet IP" // 内网IP
}
region, err := searcher.SearchByStr(ip)
if err != nil {
logger.Errorf("failed to SearchIP(%s): %s\n", ip, err)
return "未知"
return "unknown" // 未知
}
parts := strings.Split(region, "|")
province := parts[2]