From 6ce050682d7699c2e10a798a993ad5539de04a9e Mon Sep 17 00:00:00 2001 From: xuans Date: Sun, 30 Aug 2026 19:47:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E7=B4=A7=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=89=8D=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/httpapi/users_api.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/internal/httpapi/users_api.go b/backend/internal/httpapi/users_api.go index eb593ff..b1efc52 100644 --- a/backend/internal/httpapi/users_api.go +++ b/backend/internal/httpapi/users_api.go @@ -26,7 +26,10 @@ func (s *Server) requireSuperAdmin(c *gin.Context) { setupReady := s.config.SetupReady s.configMu.RUnlock() if !setupReady { - c.Next() + c.AbortWithStatusJSON(http.StatusConflict, gin.H{ + "error": "请先完成初始化配置", + "request_id": requestIDFromContext(c), + }) return } session, ok := s.currentAuthSession(c)