From 67d028cf50e9f4e00e404ee0c7db330c8af0ac3b Mon Sep 17 00:00:00 2001 From: shaw Date: Thu, 18 Dec 2025 22:59:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E6=8E=A5=E5=8F=A3404?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将后端路由与前端API调用对齐: - /user/profile -> /users/me - PUT /user/password -> POST /users/me/password --- backend/cmd/server/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/cmd/server/main.go b/backend/cmd/server/main.go index 9358775a..70540e35 100644 --- a/backend/cmd/server/main.go +++ b/backend/cmd/server/main.go @@ -227,10 +227,10 @@ func registerRoutes(r *gin.Engine, h *handler.Handlers, s *service.Services, rep authenticated.GET("/auth/me", h.Auth.GetCurrentUser) // 用户接口 - user := authenticated.Group("/user") + user := authenticated.Group("/users/me") { - user.GET("/profile", h.User.GetProfile) - user.PUT("/password", h.User.ChangePassword) + user.GET("", h.User.GetProfile) + user.POST("/password", h.User.ChangePassword) } // API Key管理