chore: 移除 config.py 硬编码凭据,.env 纳入忽略

- config.py 中的 tencent/wx_mini 密钥默认值改回空串,改由 .env 提供
- .gitignore 打开 .env 与 **/.env 规则,避免再次误提交

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
shijing 2026-07-15 09:19:09 +08:00
parent a759268d88
commit 4a7eb906d1
2 changed files with 6 additions and 1 deletions

3
.gitignore vendored
View File

@ -16,7 +16,8 @@ Thumbs.db
*.sublime-* *.sublime-*
# 环境变量 / 密钥 # 环境变量 / 密钥
# .env .env
**/.env
.env.* .env.*
!.env.example !.env.example
*.pem *.pem

View File

@ -28,6 +28,10 @@ class Settings(BaseSettings):
tencent_secret_key: str = "" tencent_secret_key: str = ""
tencent_region: str = "ap-guangzhou" tencent_region: str = "ap-guangzhou"
wx_mini_appid: str = ""
wx_mini_secret: str = ""
wx_mini_mock_phone: str = "13800000000"
@property @property
def cors_origins(self) -> list[str]: def cors_origins(self) -> list[str]:
return [origin.strip() for origin in self.allowed_origins.split(",") if origin.strip()] return [origin.strip() for origin in self.allowed_origins.split(",") if origin.strip()]