1
This commit is contained in:
parent
31d8a1fcaf
commit
b360b197a7
@ -16,4 +16,4 @@ ASTOCK_ADMIN_USERNAME=admin
|
|||||||
ASTOCK_ADMIN_PASSWORD=替换为一个安全密码
|
ASTOCK_ADMIN_PASSWORD=替换为一个安全密码
|
||||||
|
|
||||||
# 前端地址(用于 CORS)
|
# 前端地址(用于 CORS)
|
||||||
ASTOCK_FRONTEND_URL=http://your-server-ip:3000
|
ASTOCK_FRONTEND_URL=http://your-server-ip:3001
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -51,7 +51,7 @@ class Settings(BaseSettings):
|
|||||||
llm_temperature: float = 0.3
|
llm_temperature: float = 0.3
|
||||||
|
|
||||||
# 前端
|
# 前端
|
||||||
frontend_url: str = "http://localhost:3000"
|
frontend_url: str = "http://localhost:3001"
|
||||||
|
|
||||||
# JWT 认证
|
# JWT 认证
|
||||||
jwt_secret: str = "change-me-in-production"
|
jwt_secret: str = "change-me-in-production"
|
||||||
|
|||||||
@ -67,7 +67,7 @@ app = FastAPI(
|
|||||||
# CORS
|
# CORS
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
allow_origins=[settings.frontend_url, "http://localhost:3000"],
|
allow_origins=[settings.frontend_url, "http://localhost:3001"],
|
||||||
allow_credentials=True,
|
allow_credentials=True,
|
||||||
allow_methods=["*"],
|
allow_methods=["*"],
|
||||||
allow_headers=["*"],
|
allow_headers=["*"],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user