fix: always show OKX options nav tab and allow options page without redirect

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-07 08:33:23 +08:00
parent 806bb074ab
commit ae0c44e20d
5 changed files with 10 additions and 7 deletions
+4 -2
View File
@@ -52,8 +52,8 @@ def install_options_trading(app: Flask, repo_root: str, app_module: Any) -> None
attach_options_templates(app, repo_root)
cfg = _build_cfg(app_module)
app.extensions["options_cfg"] = cfg
register_options_routes(app, cfg)
if enabled:
register_options_routes(app, cfg)
_start_monitor_thread(app, cfg)
@@ -102,10 +102,12 @@ def _build_cfg(app_module: Any) -> dict[str, Any]:
def _require_options_ex(cfg: dict[str, Any]):
if not cfg.get("enabled"):
return None, "期权模块未启用,请在 .env 设置 OKX_OPTIONS_ENABLED=true 并重启 PM2"
ex = cfg.get("exchange_options")
ok, reason = cfg["options_api_ready"](ex)
if not ok:
return None, reason
return None, reason or "期权 API 未配置"
return ex, ""