diff --git a/backend/config/settings.py b/backend/config/settings.py index 38c1ea3..874aff9 100644 --- a/backend/config/settings.py +++ b/backend/config/settings.py @@ -163,4 +163,6 @@ CORS_ALLOWED_ORIGINS = [ "http://127.0.0.1:5173", ] +# 开发阶段可放开跨域,如需严格控制生产环境请关闭此项 +CORS_ALLOW_ALL_ORIGINS = True CORS_ALLOW_CREDENTIALS = True diff --git a/frontend/.env.production b/frontend/.env.production new file mode 100644 index 0000000..15a08c3 --- /dev/null +++ b/frontend/.env.production @@ -0,0 +1 @@ +VITE_API_BASE_URL=https://api.example.com/api