feat(widget): 优化访客在线轨迹、GeoIP与多站点渠道
CI / Frontend (typecheck + lint + build) (push) Successful in 2m5s
CI / Backend (go vet + test) (push) Failing after 5m20s

This commit is contained in:
yml2213
2026-11-06 18:21:30 +08:00
parent 24fac1bcf1
commit 38d6fc1684
37 changed files with 1071 additions and 123 deletions
+22
View File
@@ -0,0 +1,22 @@
package geoip
import (
"os"
"testing"
)
func TestLookupWithConfiguredDatabase(t *testing.T) {
path := os.Getenv("GEOIP_TEST_DB")
if path == "" {
t.Skip("未设置 GEOIP_TEST_DB")
}
if err := Init(path); err != nil {
t.Fatal(err)
}
defer Close()
location, ok := Lookup("8.8.8.8")
if !ok || location.Country == "" {
t.Fatalf("GeoIP 查询失败: %+v ok=%v", location, ok)
}
}