feat: dataReport 增加 disabled 开关,默认关闭埋点与上报
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -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"`
|
||||
|
||||
@@ -43,6 +43,7 @@ adCenter:
|
||||
aesKey: "gD4+rmbX5TS5cLbb3wAN5uEAYp/1j4hkQrS9SzuSjc8"
|
||||
dataReport:
|
||||
url: "https://api.shuifeng.cc"
|
||||
disabled: true
|
||||
lsjMediaConf:
|
||||
appId: "430696"
|
||||
apiKey: "ed48e96ce490bc94bd5eb5133dd542d0"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user