From 0bda9a84209adfa008b51384b00d0eddf0bedc5a Mon Sep 17 00:00:00 2001 From: xiaowei Date: Tue, 2 Jun 2026 17:34:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9D=99=E6=80=81=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=20/=20=E5=9C=A8=20Auth=20=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E4=B8=AD=E6=94=BE=E8=A1=8C=EF=BC=88=E4=BE=9B=20Web=20?= =?UTF-8?q?UI=20=E7=9B=B4=E6=8E=A5=E8=AE=BF=E9=97=AE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go/internal/api/middleware/auth.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/go/internal/api/middleware/auth.go b/go/internal/api/middleware/auth.go index 657c3fc..6f99340 100644 --- a/go/internal/api/middleware/auth.go +++ b/go/internal/api/middleware/auth.go @@ -129,8 +129,9 @@ func Auth(next http.Handler) http.Handler { } return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // /health, /metrics, /static/* 不需要认证 - if r.URL.Path == "/health" || r.URL.Path == "/metrics" || strings.HasPrefix(r.URL.Path, "/static/") { + // /health, /metrics, /static/*, / 不需要认证(/ 供 Web UI 使用) + if r.URL.Path == "/health" || r.URL.Path == "/metrics" || + strings.HasPrefix(r.URL.Path, "/static/") || r.URL.Path == "/" { next.ServeHTTP(w, r) return }