feat(gateway): 接入42和72并为42/52/72启用可刷新令牌
This commit is contained in:
+1
-5
@@ -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 地址")
|
||||
|
||||
Reference in New Issue
Block a user