From 991ae4834c1004ef1e9c56a9c3e285174be50b23 Mon Sep 17 00:00:00 2001 From: hhs <386998068@qq.com> Date: Sat, 13 Jun 2026 15:18:11 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20Phase=201=20=E7=A7=BB=E9=99=A4=20CORS?= =?UTF-8?q?=20=E4=B8=AD=E9=97=B4=E4=BB=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CORS 由 Nginx 反向代理统一处理,不在后端实现 --- docs/PLAN_BACKEND.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/PLAN_BACKEND.md b/docs/PLAN_BACKEND.md index a696571..a069e09 100644 --- a/docs/PLAN_BACKEND.md +++ b/docs/PLAN_BACKEND.md @@ -20,8 +20,9 @@ | 1.2 | 实现错误码常量 + WS 错误发送工具 | `internal/errors/codes.go` | 10 个错误码常量 + `SendWSError(client, code, requestID, err)` | | 1.3 | main.go 接入 config.Load() | `cmd/server/main.go` | 用 `cfg.Server.Host:Port` 替换硬编码 `:8080`,初始化 logger | | 1.4 | 添加 graceful shutdown | `cmd/server/main.go` | `signal.NotifyContext` + `http.Server.Shutdown`,10s drain | -| 1.5 | 添加 CORS 中间件 | `cmd/server/main.go` | 开发阶段允许所有来源,生产走 Nginx 同源 | -| 1.6 | 添加 .gitignore | `backend/.gitignore` | 排除 `server` 二进制、`.env`、`tmp/` | +| 1.5 | 添加 .gitignore | `backend/.gitignore` | 排除 `server` 二进制、`.env`、`tmp/` | + +> **CORS**:不在此处实现,生产环境由 Nginx 反向代理统一处理跨域。 ---