```
feat(rpc): 设置默认RPC地址为本地回环 修复RPC客户端连接问题,将默认服务器地址设置为127.0.0.1以确保本地连接正常 refactor(qqwry): 优化IP地址查询功能 移除不必要的正则表达式依赖,重构IP地址查询逻辑,提高代码性能和可维护性 fix(server): 保存确定的端口到配置中 确保服务器端口在确定后正确保存到配置中,避免端口配置丢失
This commit is contained in:
@@ -2,6 +2,7 @@ package service
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"blazing/modules/base/model"
|
||||
@@ -33,22 +34,38 @@ func NewBaseSysLogService() *BaseSysLogService {
|
||||
},
|
||||
},
|
||||
ModifyResult: func(ctx g.Ctx, data interface{}) interface{} {
|
||||
// baseSysLog.IPAddr = fmt.Sprintf("国家:%s,省份:%s,城市:%s,区县:%s,运营商:%s\n",
|
||||
// location.Country,
|
||||
// location.Province,
|
||||
// location.City,
|
||||
// location.District,
|
||||
// location.ISP,
|
||||
// )
|
||||
|
||||
var rr []g.MapStrAny
|
||||
r, _ := gconv.Map(data)["list"].(gdb.Result)
|
||||
for _, v := range r {
|
||||
ipaddr, err := qqwry.QueryIP(v.Map()["ip"].(string))
|
||||
for i := 0; i < len(r); i++ {
|
||||
subm := r[i].GMap()
|
||||
ipaddr, err := qqwry.QueryIP(r[i].Map()["ip"].(string))
|
||||
if err == nil {
|
||||
v.GMap().Set("ipAddr", ipaddr)
|
||||
// baseSysLog.IPAddr = fmt.Sprintf("国家:%s,省份:%s,城市:%s,区县:%s,运营商:%s\n",
|
||||
// location.Country,
|
||||
// location.Province,
|
||||
// location.City,
|
||||
// location.District,
|
||||
// location.ISP,
|
||||
// )
|
||||
|
||||
subm.Set("ipAddr", fmt.Sprintf("国家:%s,省份:%s,城市:%s,区县:%s,运营商:%s\n",
|
||||
ipaddr.Country,
|
||||
ipaddr.Province,
|
||||
ipaddr.City,
|
||||
ipaddr.District,
|
||||
ipaddr.ISP,
|
||||
))
|
||||
|
||||
}
|
||||
|
||||
rr = append(rr, subm.MapStrAny())
|
||||
}
|
||||
|
||||
data.(map[string]interface{})["list"] = rr
|
||||
|
||||
return data
|
||||
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user