fix: KGEmptyError 自定义异常 + CORS 环境变量配置
- qa_service 定义 KGEmptyError 异常,run_query 抛出;routers/query 精确捕获 → HTTP 400 + code 3002,移除字符串匹配 - main.py CORS 改为读 CORS_ORIGINS 环境变量:未设置时 wildcard + credentials=False(合规默认),设置后显式列表 + credentials=True - .env.example 新增 CORS_ORIGINS 默认值(后端 + 前端 4 个域名)
This commit is contained in:
@@ -19,3 +19,5 @@ KEYCLOAK_REALM=plfai
|
||||
KEYCLOAK_CLIENT_ID=graphrag-backend
|
||||
KEYCLOAK_CLIENT_SECRET=your_keycloak_client_secret_here
|
||||
KEYCLOAK_AUDIENCE=account
|
||||
|
||||
CORS_ORIGINS=https://graphrag-backend.plfai.cn,https://test-graphrag-backend.plfai.cn,https://graphrag.plfai.cn,https://test-graphrag.plfai.cn
|
||||
|
||||
Reference in New Issue
Block a user