From 53e04c2fc2aae6758f37c9a823bdd0f4ff75cc82 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sun, 6 Oct 2024 15:43:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/user.go | 2 +- proto/status.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/handler/user.go b/handler/user.go index f80d326..3f55d78 100644 --- a/handler/user.go +++ b/handler/user.go @@ -53,7 +53,7 @@ func GetUserInfo(c *gin.Context) { var req_data GetUserInfoReq id, _ := c.Get("id") user_id := int(id.(float64)) - if err := c.ShouldBind(&req_data); err != nil { + if err := c.ShouldBind(&req_data); err == nil { var user dao.User if req_data.ID == user_id { user = dao.FindUserByID2(user_id) diff --git a/proto/status.go b/proto/status.go index ddd36af..b259edf 100644 --- a/proto/status.go +++ b/proto/status.go @@ -18,9 +18,9 @@ const ( TokenParseError = 19 // Token解析错误 // 用户名密码相关错误码 - UsernameOrPasswordError = 6 // 用户名或密码错误 - UsernameExists = 7 // 用户名已存在 - PermissionDenied = 8 // 权限不足 + UsernameOrPasswordError = 6 // 用户名或密码错误 + UsernameExists = 7 // 用户名已存在 + PermissionDenied = 21 // 权限不足 // Redis相关错误码 RedisSetError = 8 // 设置redis错误