From 6acfb4277e9dfa5d8310f7f82ba841602563a581 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Mon, 8 Jul 2024 10:45:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B3=A8=E5=86=8C=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF=E4=B8=8E=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handler/user.go b/handler/user.go index 269078c..5e1ffdc 100644 --- a/handler/user.go +++ b/handler/user.go @@ -254,7 +254,7 @@ func registerHandler(c *gin.Context) { var req_data RLReq tokenString := "" var id uint - if err := c.ShouldBindJSON(&req_data); err == nil { + if err := c.ShouldBind(&req_data); err == nil { if len(req_data.Password) != 32 { hasher := md5.New() hasher.Write([]byte(req_data.Password)) // 生成密码的 MD5 散列值 @@ -281,7 +281,7 @@ func registerHandler(c *gin.Context) { return } } else { - c.JSON(200, gin.H{"error": err.Error(), "code": proto.DeviceRestartFailed, "message": "error"}) + c.JSON(200, gin.H{"error": err.Error(), "code": proto.ParameterError, "message": "error"}) return } fmt.Println(req_data)