feat(gateway): 接入42和72并为42/52/72启用可刷新令牌

This commit is contained in:
xsl
2026-11-07 20:50:22 +08:00
parent dc53a0ecfe
commit 51baf96d78
24 changed files with 1312 additions and 126 deletions
+1 -5
View File
@@ -13,7 +13,7 @@ logger = logging.getLogger("gateway.config")
CONFIG_PATH = Path(__file__).resolve().parent / "config.json"
DEFAULTS = {
"interface52_token": "yonghe1999",
"api_token_secret": "",
"public_base_url": "https://hair.xiangsilian.com",
"static_dir": "static/annotations",
"primary_workers": [], # 主 worker 地址列表(须为 workers 的子集);空 = 全部视为主 worker
@@ -77,10 +77,6 @@ def load_config() -> dict:
cfg = _deep_merge(DEFAULTS, raw)
# --- 校验 ---
client_token = cfg["interface52_token"]
if not isinstance(client_token, str) or not client_token:
raise ValueError("配置错误: interface52_token 必须是非空字符串")
workers: List[str] = cfg.get("workers", [])
if not workers:
raise ValueError("配置错误: workers 列表不能为空,至少需要一个 worker 地址")