ziwen 1 年之前
父节点
当前提交
90c797f925
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      controller/auth.go

+ 1 - 1
controller/auth.go

@@ -136,7 +136,7 @@ func (a *AuthController) Register(c *gin.Context) {
 	}
 	}
 	userId := 0
 	userId := 0
 	password := utils.MD5(req.Password + utils.KEY)
 	password := utils.MD5(req.Password + utils.KEY)
-	if emailItem != nil {
+	if emailItem.Id > 0 {
 		if emailItem.Status == 1 && emailItem.Password == "" {
 		if emailItem.Status == 1 && emailItem.Password == "" {
 			//已经是正式用户,更新密码即可
 			//已经是正式用户,更新密码即可
 			emailItem.Password = password
 			emailItem.Password = password