feat: add demo site config

This commit is contained in:
engigu
2025-12-25 21:46:06 +08:00
parent 9bf9e5b5b8
commit 9c77601215
9 changed files with 67 additions and 6 deletions
+6
View File
@@ -103,6 +103,12 @@ func LoadConfig(path string) (*AppConfig, error) {
// 设置 Secret 到 constant 包
constant.Secret = Config.Security.Secret
// 设置演示模式
if v := os.Getenv("BH_DEMO_MODE"); v == "true" || v == "1" {
constant.DemoMode = true
log.Printf("[Config] Demo mode enabled")
}
// 输出配置信息(隐藏敏感信息)
log.Printf("[Config] Server: %s:%d", Config.Server.Host, Config.Server.Port)
log.Printf("[Config] Database: type=%s, host=%s, port=%d, dbname=%s",