From b9d5aa5fb13b9c5a57af3383a21aa1f2dadf3f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Sun, 13 Oct 2024 00:35:56 +0800 Subject: [PATCH] fix: panel version --- config.example.yml | 1 - internal/bootstrap/conf.go | 2 +- internal/service/cli.go | 2 +- pkg/types/config.go | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/config.example.yml b/config.example.yml index 0b41258700..9e27d34c36 100644 --- a/config.example.yml +++ b/config.example.yml @@ -5,7 +5,6 @@ app: key: a-long-string-with-32-characters locale: zh_CN timezone: Asia/Shanghai - version: 2.3.0 root: /www http: debug: false diff --git a/internal/bootstrap/conf.go b/internal/bootstrap/conf.go index eab79d8429..44c5b6de09 100644 --- a/internal/bootstrap/conf.go +++ b/internal/bootstrap/conf.go @@ -26,7 +26,7 @@ func initConf() { func initGlobal() { app.Root = app.Conf.MustString("app.root") - app.Version = app.Conf.MustString("app.version") + app.Version = "2.3.0" app.Locale = app.Conf.MustString("app.locale") // 初始化时区 diff --git a/internal/service/cli.go b/internal/service/cli.go index 540ed7bf47..d0e1fc109a 100644 --- a/internal/service/cli.go +++ b/internal/service/cli.go @@ -496,7 +496,7 @@ func (s *CliService) Init(ctx context.Context, cmd *cli.Command) error { return fmt.Errorf("已经初始化过了") } - settings := []biz.Setting{{Key: biz.SettingKeyName, Value: "耗子面板"}, {Key: biz.SettingKeyMonitor, Value: "1"}, {Key: biz.SettingKeyMonitorDays, Value: "30"}, {Key: biz.SettingKeyBackupPath, Value: filepath.Join(app.Root, "backup")}, {Key: biz.SettingKeyWebsitePath, Value: filepath.Join(app.Root, "wwwroot")}, {Key: biz.SettingKeyVersion, Value: app.Conf.String("app.version")}} + settings := []biz.Setting{{Key: biz.SettingKeyName, Value: "耗子面板"}, {Key: biz.SettingKeyMonitor, Value: "1"}, {Key: biz.SettingKeyMonitorDays, Value: "30"}, {Key: biz.SettingKeyBackupPath, Value: filepath.Join(app.Root, "backup")}, {Key: biz.SettingKeyWebsitePath, Value: filepath.Join(app.Root, "wwwroot")}, {Key: biz.SettingKeyVersion, Value: app.Version}} if err := app.Orm.Create(&settings).Error; err != nil { return fmt.Errorf("初始化失败:%v", err) } diff --git a/pkg/types/config.go b/pkg/types/config.go index 6edb9d4545..77ecd51510 100644 --- a/pkg/types/config.go +++ b/pkg/types/config.go @@ -12,7 +12,6 @@ type PanelAppConfig struct { Key string `yaml:"key"` Locale string `yaml:"locale"` Timezone string `yaml:"timezone"` - Version string `yaml:"version"` Root string `yaml:"root"` }