修复注册解析参数错误与返回参数错误
This commit is contained in:
parent
a54d1f93f1
commit
6acfb4277e
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue