ziwen hai 1 ano
pai
achega
e308820c8e
Modificáronse 1 ficheiros con 8 adicións e 17 borrados
  1. 8 17
      controller/auth.go

+ 8 - 17
controller/auth.go

@@ -119,7 +119,7 @@ func (a *AuthController) Register(c *gin.Context) {
 	item, err := msg_code.GetMsgCode(req.Email, req.SmsCode)
 	if err != nil {
 		if err != nil {
-			resp.Fail("校验验证码失败,Err:"+err.Error(), c)
+			resp.Fail("Verification code error."+err.Error(), c)
 			return
 		}
 	}
@@ -353,8 +353,8 @@ func (a *AuthController) BindMobile(c *gin.Context) {
 	emailItem := new(english_report_email.Email)
 	userEmail, err := emailItem.GetByMobile(req.Mobile, req.CountryCode)
 	if err != nil && err != utils.ErrNoRow {
-			resp.FailData("获取客户邮箱信息失败 ", "Err:"+err.Error(), c)
-			return
+		resp.FailData("获取客户邮箱信息失败 ", "Err:"+err.Error(), c)
+		return
 	}
 
 	if userEmail.Id != 0 {
@@ -364,13 +364,8 @@ func (a *AuthController) BindMobile(c *gin.Context) {
 
 	item, err := msg_code.GetMsgCode(req.Mobile, req.SmsCode)
 	if err != nil {
-		if err == utils.ErrNoRow {
-			resp.Fail("校验验证码失败,Err:"+err.Error(), c)
-			return
-		} else {
-			resp.Fail("校验验证码失败,Err:"+err.Error(), c)
-			return
-		}
+		resp.Fail("Verification code error."+err.Error(), c)
+		return
 	}
 	if item == nil {
 		resp.Fail("验证码错误,请重新输入", c)
@@ -447,13 +442,9 @@ func (a *AuthController) ForgetPwd(c *gin.Context) {
 
 	item, err := msg_code.GetMsgCode(req.Account, req.SmsCode)
 	if err != nil {
-		if err == utils.ErrNoRow {
-			resp.Fail("校验验证码失败,Err:"+err.Error(), c)
-			return
-		} else {
-			resp.Fail("校验验证码失败,Err:"+err.Error(), c)
-			return
-		}
+		resp.Fail("Verification code error."+err.Error(), c)
+		return
+
 	}
 	if item == nil {
 		resp.Fail("验证码错误,请重新输入", c)