修复 CORS 配置:加入前端默认端口 9948

前端 Vite 运行在 localhost:9948,但默认 CORS 只允许 8080/5173,
导致浏览器预检请求失败,前端报 Network Error
This commit is contained in:
祀梦
2026-04-02 12:15:08 +08:00
parent 7336070cc3
commit 96bac1a7c1
2 changed files with 2 additions and 2 deletions

View File

@@ -35,4 +35,4 @@ PLUGINS_DIR=plugins
# ==================== CORS配置 ====================
# 允许的来源域名,用逗号分隔
CORS_ORIGINS=http://localhost:8080,http://localhost:5173
CORS_ORIGINS=http://localhost:8080,http://localhost:5173,http://localhost:9948

View File

@@ -44,7 +44,7 @@ class Settings(BaseSettings):
plugins_dir: str = "plugins"
# CORS 配置
cors_origins: str = "http://localhost:8080,http://localhost:5173"
cors_origins: str = "http://localhost:8080,http://localhost:5173,http://localhost:9948"
@property
def cors_origins_list(self) -> List[str]: