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:
@@ -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, ""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user