From 0211e15fc98ec1ae2a3af8140bf5d838e4266f6e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 30 Oct 2022 01:02:14 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=AF=E6=8C=81=E5=85=B3=E9=97=AD=20?= =?UTF-8?q?Google=20Analytics=20https://github.com/siyuan-note/siyuan/issu?= =?UTF-8?q?es/6403?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/api/system.go | 2 +- kernel/conf/system.go | 6 +++--- kernel/model/conf.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/api/system.go b/kernel/api/system.go index 0e503a8f7..b0fff8ef1 100644 --- a/kernel/api/system.go +++ b/kernel/api/system.go @@ -312,7 +312,7 @@ func setGoogleAnalytics(c *gin.Context) { } googleAnalytics := arg["googleAnalytics"].(bool) - model.Conf.System.GoogleAnalytics = googleAnalytics + model.Conf.System.DisableGoogleAnalytics = googleAnalytics model.Conf.Save() } diff --git a/kernel/conf/system.go b/kernel/conf/system.go index 13fc13861..626b65b8a 100644 --- a/kernel/conf/system.go +++ b/kernel/conf/system.go @@ -38,9 +38,9 @@ type System struct { FixedPort bool `json:"fixedPort"` // 是否使用固定端口 6806 NetworkProxy *NetworkProxy `json:"networkProxy"` - UploadErrLog bool `json:"uploadErrLog"` - GoogleAnalytics bool `json:"googleAnalytics"` - DownloadInstallPkg bool `json:"downloadInstallPkg"` + UploadErrLog bool `json:"uploadErrLog"` + DisableGoogleAnalytics bool `json:"disableGoogleAnalytics"` + DownloadInstallPkg bool `json:"downloadInstallPkg"` } func NewSystem() *System { diff --git a/kernel/model/conf.go b/kernel/model/conf.go index 053d1ea16..211507130 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -292,7 +292,7 @@ func InitConf() { }) } - if !Conf.System.GoogleAnalytics { + if Conf.System.DisableGoogleAnalytics { logging.LogInfof("user has disabled [Google Analytics]") }