feat: 后端跨域

This commit is contained in:
caoqianming 2026-03-10 16:43:57 +08:00
parent 80a8f69edf
commit 1440767c69
2 changed files with 3 additions and 0 deletions

View File

@ -163,4 +163,6 @@ CORS_ALLOWED_ORIGINS = [
"http://127.0.0.1:5173",
]
# 开发阶段可放开跨域,如需严格控制生产环境请关闭此项
CORS_ALLOW_ALL_ORIGINS = True
CORS_ALLOW_CREDENTIALS = True

1
frontend/.env.production Normal file
View File

@ -0,0 +1 @@
VITE_API_BASE_URL=https://api.example.com/api