From 830fb574e6c8420b50e49568bef89cdaea807198 Mon Sep 17 00:00:00 2001 From: zhouyonggao <1971162852@qq.com> Date: Fri, 28 Nov 2025 14:47:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DYMT=E5=AF=86=E9=92=A5?= =?UTF-8?q?=E8=A7=A3=E5=AF=86=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=BD=8D=E7=BD=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将YMT_KEY_DECRYPT_KEY_B64环境变量设置从文件末尾移至main函数开始处 确保在日志初始化前完成环境变量配置 --- server/cmd/server/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/cmd/server/main.go b/server/cmd/server/main.go index fd151a2..262f3cd 100644 --- a/server/cmd/server/main.go +++ b/server/cmd/server/main.go @@ -14,6 +14,7 @@ import ( func main() { cfg := config.Load() + if cfg.YMTKeyDecryptKeyB64 != "" { os.Setenv("YMT_KEY_DECRYPT_KEY_B64", cfg.YMTKeyDecryptKeyB64) } _ = logging.Init("log") log.Println("connecting YMT MySQL:", cfg.YMTDB.Host+":"+cfg.YMTDB.Port, "db", cfg.YMTDB.Name, "user", cfg.YMTDB.User) log.Println("connecting Marketing MySQL:", cfg.MarketingDB.Host+":"+cfg.MarketingDB.Port, "db", cfg.MarketingDB.Name, "user", cfg.MarketingDB.User) @@ -52,4 +53,3 @@ func main() { } // buildDSN deprecated; use cfg.YMTDB.DSN()/cfg.MarketingDB.DSN() - if cfg.YMTKeyDecryptKeyB64 != "" { os.Setenv("YMT_KEY_DECRYPT_KEY_B64", cfg.YMTKeyDecryptKeyB64) }