From 45616b4ab3e2587114069bfa85e0717f09ec2c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Wed, 7 Jan 2026 23:47:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/setting.go | 2 ++ internal/data/website.go | 5 ++++- internal/service/cli.go | 1 + pkg/config/config.go | 18 ++++++++++-------- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/internal/biz/setting.go b/internal/biz/setting.go index 9458b525..85b4cd82 100644 --- a/internal/biz/setting.go +++ b/internal/biz/setting.go @@ -20,6 +20,8 @@ const ( SettingKeyOfflineMode SettingKey = "offline_mode" SettingKeyAutoUpdate SettingKey = "auto_update" SettingKeyWebserver SettingKey = "webserver" + SettingHiddenMenu SettingKey = "hidden_menu" + SettingKeyCustomLogo SettingKey = "custom_logo" ) type Setting struct { diff --git a/internal/data/website.go b/internal/data/website.go index 12feda48..d53e936e 100644 --- a/internal/data/website.go +++ b/internal/data/website.go @@ -815,6 +815,9 @@ func (r *websiteRepo) reloadWebServer() error { _, err = shell.Execf("apachectl configtest") return err } + default: + return errors.New(r.t.Get("unsupported web server: %s", webServer)) } - return errors.New(r.t.Get("unsupported web server: %s", webServer)) + + return nil } diff --git a/internal/service/cli.go b/internal/service/cli.go index f3b104f2..ef8a9862 100644 --- a/internal/service/cli.go +++ b/internal/service/cli.go @@ -878,6 +878,7 @@ func (s *CliService) Init(ctx context.Context, cmd *cli.Command) error { {Key: biz.SettingKeyWebsitePath, Value: filepath.Join(app.Root, "wwwroot")}, {Key: biz.SettingKeyOfflineMode, Value: "false"}, {Key: biz.SettingKeyAutoUpdate, Value: "true"}, + {Key: biz.SettingHiddenMenu, Value: "[]"}, } if err := s.db.Create(&settings).Error; err != nil { return errors.New(s.t.Get("Initialization failed: %v", err)) diff --git a/pkg/config/config.go b/pkg/config/config.go index 6ac5763a..8f325259 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -29,14 +29,16 @@ type AppConfig struct { } type HTTPConfig struct { - Debug bool `yaml:"debug"` - Port uint `yaml:"port"` - Entrance string `yaml:"entrance"` - TLS bool `yaml:"tls"` - IPHeader string `yaml:"ip_header"` - BindDomain []string `yaml:"bind_domain"` - BindIP []string `yaml:"bind_ip"` - BindUA []string `yaml:"bind_ua"` + Debug bool `yaml:"debug"` + Port uint `yaml:"port"` + Entrance string `yaml:"entrance"` + EntranceError string `yaml:"entrance_error"` + TLS bool `yaml:"tls"` + LoginCaptcha bool `yaml:"login_captcha"` + IPHeader string `yaml:"ip_header"` + BindDomain []string `yaml:"bind_domain"` + BindIP []string `yaml:"bind_ip"` + BindUA []string `yaml:"bind_ua"` } type DatabaseConfig struct {