feat: 增强 WebUI 配置,支持防爬虫和安全 Cookie 设置

This commit is contained in:
墨梓柒
2025-12-19 00:44:22 +08:00
parent d3b71a7181
commit 3231995ebd
10 changed files with 107 additions and 47 deletions

View File

@@ -44,10 +44,9 @@ class MainSystem:
def _setup_webui_server(self):
"""设置独立的 WebUI 服务器"""
import os
from src.config.config import global_config
webui_enabled = os.getenv("WEBUI_ENABLED", "false").lower() == "true"
if not webui_enabled:
if not global_config.webui.enabled:
logger.info("WebUI 已禁用")
return