修复 CORS 配置:加入前端默认端口 9948
前端 Vite 运行在 localhost:9948,但默认 CORS 只允许 8080/5173, 导致浏览器预检请求失败,前端报 Network Error
This commit is contained in:
@@ -35,4 +35,4 @@ PLUGINS_DIR=plugins
|
|||||||
|
|
||||||
# ==================== CORS配置 ====================
|
# ==================== CORS配置 ====================
|
||||||
# 允许的来源域名,用逗号分隔
|
# 允许的来源域名,用逗号分隔
|
||||||
CORS_ORIGINS=http://localhost:8080,http://localhost:5173
|
CORS_ORIGINS=http://localhost:8080,http://localhost:5173,http://localhost:9948
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class Settings(BaseSettings):
|
|||||||
plugins_dir: str = "plugins"
|
plugins_dir: str = "plugins"
|
||||||
|
|
||||||
# CORS 配置
|
# CORS 配置
|
||||||
cors_origins: str = "http://localhost:8080,http://localhost:5173"
|
cors_origins: str = "http://localhost:8080,http://localhost:5173,http://localhost:9948"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cors_origins_list(self) -> List[str]:
|
def cors_origins_list(self) -> List[str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user