task: add send common mail task
All checks were successful
Gitea Actions Demo / deploy (push) Successful in 11s

This commit is contained in:
konjacpotato
2026-02-15 15:53:48 +08:00
parent 200550b4f8
commit 5c3c429620
19 changed files with 334 additions and 6 deletions

22
config/env_loader.py Normal file
View File

@ -0,0 +1,22 @@
import os
from dotenv import load_dotenv
def load_env():
"""
自动根据 ENV 加载对应的 .env 文件
"""
base_file = ".env"
prod_file = ".env.prod"
test_file = ".env.test"
# 先加载基础 .env
if os.path.exists(base_file):
load_dotenv(base_file)
# 根据参数 ENV 再加载其他环境
env = os.getenv("ENV", "dev")
if env == "prod" and os.path.exists(prod_file):
load_dotenv(prod_file, override=True)
elif env == "test" and os.path.exists(test_file):
load_dotenv(test_file, override=True)