diff --git a/python-api/.env.example b/python-api/.env.example index 2c6e920..c6a12b8 100644 --- a/python-api/.env.example +++ b/python-api/.env.example @@ -36,7 +36,7 @@ ALGORITHM=HS256 # === CORS 配置 === # 本地开发: 允许 localhost # 测试/生产服: 填写实际域名,如 https://app.yourdomain.com -CORS_ORIGINS=http://localhost:1420,http://127.0.0.1:1420,http://localhost:8080 +CORS_ORIGINS=http://localhost:1420,http://127.0.0.1:1420,http://localhost:8080,tauri://localhost,http://tauri.localhost # === AI 平台配置 === diff --git a/python-api/app/config.py b/python-api/app/config.py index b2bb282..05c41e4 100644 --- a/python-api/app/config.py +++ b/python-api/app/config.py @@ -88,7 +88,7 @@ class Settings(BaseSettings): # CORS 配置 CORS_ORIGINS: str = Field( - default="http://localhost:1420,http://127.0.0.1:1420,http://localhost:8080,http://127.0.0.1:8080,tauri://localhost", + default="http://localhost:1420,http://127.0.0.1:1420,http://localhost:8080,http://127.0.0.1:8080,tauri://localhost,http://tauri.localhost", description="允许的跨域来源(逗号分隔)", )