修复国旗展示

This commit is contained in:
奶爸
2019-12-11 14:10:48 +08:00
parent d862c834de
commit 71efbdfbe9
4 changed files with 8 additions and 10 deletions

View File

@@ -19,8 +19,8 @@ import (
)
type ipDotSbGeoIP struct {
CountryCode string
IP string
CountryCode string `json:"country_code,omitempty"`
IP string `json:"ip,omitempty"`
}
var netInSpeed, netOutSpeed, netInTransfer, netOutTransfer, lastUpdate uint64
@@ -33,10 +33,7 @@ func GetHost() *model.Host {
for i := 0; i < len(ci); i++ {
cpus = append(cpus, fmt.Sprintf("%v-%vC%vT", ci[i].ModelName, ci[i].Cores, ci[i].Stepping))
}
ip := ipDotSbGeoIP{
IP: "127.0.0.1",
CountryCode: "cn",
}
var ip ipDotSbGeoIP
resp, err := http.Get("https://api.ip.sb/geoip")
if err == nil {
defer resp.Body.Close()