feat: improve campus bike discovery and add independent live preview

This commit is contained in:
zzy
2026-11-04 16:42:47 +08:00
parent f986c8deae
commit b6b7b3dbe5
42 changed files with 5267 additions and 4313 deletions
+7
View File
@@ -106,10 +106,17 @@ def _load_smtp_config() -> dict:
cfg[k] = v.strip()
except Exception as e:
print(f"[SMTP配置] 读取失败: {e}")
import os
for key in cfg:
if os.environ.get(key.upper()) is not None:
cfg[key] = os.environ[key.upper()]
return cfg
def send_email(to_email: str, subject: str, body: str, html_body: str = None) -> bool:
from runtime_mode import PREVIEW_MODE
if PREVIEW_MODE and str(to_email).lower() in ("demo@preview.local", "friend@preview.local"):
return True # Demonstration recipients are synthetic; real alert emails use SMTP.
"""发送邮件,可同时提供纯文本和 HTML 版本,返回是否成功。"""
cfg = _load_smtp_config()
if not cfg["smtp_user"] or not cfg["smtp_pass"]: