fix: resolve domain.ts type errors and SWR fetching bugs; fix vps config unmarshal issue

This commit is contained in:
Bot
2026-04-26 22:07:27 +08:00
parent 825bcb08f4
commit 1e4fae5306
16 changed files with 2513 additions and 2057 deletions
+25
View File
@@ -0,0 +1,25 @@
package main
import (
"encoding/json"
"fmt"
"strings"
)
type Config struct {
IPReportPeriod int `json:"ip_report_period"`
}
func main() {
jsonData := `{"ip_report_period":30, "unknown_field": 123}`
var c Config
dec := json.NewDecoder(strings.NewReader(jsonData))
dec.DisallowUnknownFields()
err := dec.Decode(&c)
if err != nil {
fmt.Println("Error:", err)
} else {
fmt.Println("Success")
}
}