فهرست منبع

fix: 微信用户重复登录

hsun 3 سال پیش
والد
کامیت
9b6b5cfaa5
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      services/user/user.go

+ 4 - 1
services/user/user.go

@@ -238,12 +238,15 @@ QUERY_WX_USER:
 				if platformUser.CountryCode != "" {
 					countryCode, _ = strconv.Atoi(platformUser.CountryCode)
 				}
-				_, _, tempErr, errMsg := 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("自动绑定公众号用户失败" + errMsg)
 					return
 				}
+				token = tempToken
+				userId = int(tempUser.UserID)
 				isBind = true
+				return
 			}
 		}
 	} else if wxUserErr != nil {