From 4a7eb906d18b9f01af772c09efd9d5ee9e950bd7 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 15 Jul 2026 09:19:09 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=20config.py=20?= =?UTF-8?q?=E7=A1=AC=E7=BC=96=E7=A0=81=E5=87=AD=E6=8D=AE=EF=BC=8C.env=20?= =?UTF-8?q?=E7=BA=B3=E5=85=A5=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - config.py 中的 tencent/wx_mini 密钥默认值改回空串,改由 .env 提供 - .gitignore 打开 .env 与 **/.env 规则,避免再次误提交 Co-Authored-By: Claude Opus 4.7 --- .gitignore | 3 ++- backend/app/config.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 519c552..f56b660 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,8 @@ Thumbs.db *.sublime-* # 环境变量 / 密钥 -# .env +.env +**/.env .env.* !.env.example *.pem diff --git a/backend/app/config.py b/backend/app/config.py index e8094f3..235a7af 100644 --- a/backend/app/config.py +++ b/backend/app/config.py @@ -28,6 +28,10 @@ class Settings(BaseSettings): tencent_secret_key: str = "" tencent_region: str = "ap-guangzhou" + wx_mini_appid: str = "" + wx_mini_secret: str = "" + wx_mini_mock_phone: str = "13800000000" + @property def cors_origins(self) -> list[str]: return [origin.strip() for origin in self.allowed_origins.split(",") if origin.strip()]