feat: dataReport 增加 disabled 开关,默认关闭埋点与上报

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 21:37:25 +08:00
co-authored by Claude Opus 4.7
parent d38138aeda
commit aad2f60705
10 changed files with 35 additions and 8 deletions
+2 -1
View File
@@ -110,7 +110,8 @@ type GlobalCfgEx struct {
AesKey string `yaml:"aesKey"` // 数据解密KEY
} `yaml:"adCenter"`
DataReport struct {
Url string `yaml:"url"`
Url string `yaml:"url"`
Disabled bool `yaml:"disabled"`
} `yaml:"dataReport"`
LsjMediaConf struct {
AppId string `yaml:"appId"`
+1
View File
@@ -43,6 +43,7 @@ adCenter:
aesKey: "gD4+rmbX5TS5cLbb3wAN5uEAYp/1j4hkQrS9SzuSjc8"
dataReport:
url: "https://api.shuifeng.cc"
disabled: true
lsjMediaConf:
appId: "430696"
apiKey: "ed48e96ce490bc94bd5eb5133dd542d0"
+3 -2
View File
@@ -74,8 +74,9 @@ func Run(args []string) {
initData()
ipstatsync.StartSync()
dataReport.Init(dataReport.Config{
ApiUrl: appg.Conf.DataReport.Url,
RunMod: appg.Conf.RunMod,
ApiUrl: appg.Conf.DataReport.Url,
RunMod: appg.Conf.RunMod,
Disabled: appg.Conf.DataReport.Disabled,
})
initHttpServer()
+3
View File
@@ -428,6 +428,9 @@ func md5String(input string) string {
}
func insertEvent(event dataReport.CommonField) {
if !dataReport.Enabled() {
return
}
b, _ := json.Marshal(event)
if err := eventmod.InsertOneEvent(context.Background(), &eventmod.Event{
EventId: event.EventID,