Browse Source

Merge branch 'fix_chart_refresh' of hongze/hongze_yb into master

hsun 3 years ago
parent
commit
11fae833f4
2 changed files with 5 additions and 3 deletions
  1. 2 2
      services/user/user.go
  2. 3 1
      services/user/user_bind.go

+ 2 - 2
services/user/user.go

@@ -295,9 +295,9 @@ QUERY_WX_USER:
 				if platformUser.CountryCode != "" {
 					countryCode, _ = strconv.Atoi(platformUser.CountryCode)
 				}
-				tempToken, tempUser, tempErr, _ := BindWxUser(openId, platformUser.Mobile, platformUser.Email, "", 3, countryCode, 1)
+				tempToken, tempUser, tempErr, errMsg := BindWxUser(openId, platformUser.Mobile, platformUser.Email, "", 3, countryCode, 1)
 				if tempErr != nil {
-					err = errors.New("自动绑定公众号用户失败,Err:" + tempErr.Error())
+					err = errors.New("自动绑定公众号用户失败,Err:" + tempErr.Error() + ", errMsg:" + errMsg)
 					return
 				}
 				token = tempToken

+ 3 - 1
services/user/user_bind.go

@@ -58,6 +58,7 @@ func BindWxUser(openid, mobile, email, code string, bindType, areaNum, registerP
 		if errMsg == `` {
 			errMsg = "绑定失败:" + err.Error()
 		}
+		err = errors.New("BindWxUser绑定失败: " + err.Error())
 		return
 	}
 
@@ -93,9 +94,10 @@ func BindWxUser(openid, mobile, email, code string, bindType, areaNum, registerP
 		token = sessionItem.AccessToken
 		_ = sessionItem.UpdateSession(int64(userInfo.UserID), time.Now().AddDate(0, 1, 0))
 	}
+	err = nil
 
 	tmpErr := wx_user.ModifyFirstLogin(userInfo.UserID)
-	if err != nil {
+	if tmpErr != nil {
 		fmt.Println("变更联系人是否第一次登录失败,ERR:", tmpErr)
 		return
 	}