Browse Source

Revert "feat:合并"

This reverts commit 1169fb647ed51c8ad73224d29ddfdf57d6a39dad.
wangshan 1 year ago
parent
commit
ef485b0a38
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/service/action/exhibition.go

+ 5 - 5
src/service/action/exhibition.go

@@ -41,7 +41,7 @@ func (w *ExhibitionStruct) GetExhibitionActiveHref(email, phone, source string,
 	//phone  绑定此手机号
 	if thisPhone, _ := session.Get("phone").(string); thisPhone == "" {
 		//进行手机号绑定-1、新用户绑定手机号后强制合并;2、老用户绑定手机号让用户自己选择账号合并
-		token = AccountMerge(phone, email, mgoUserId, session, isApp)
+		token = AccountMerge(phone, email, mgoUserId, session)
 		userId, _ = session.Get("userId").(string)
 	}
 	log.Println("phone-----:", session.Get("phone"), "-----", userId)
@@ -64,7 +64,7 @@ func (w *ExhibitionStruct) GetExhibitionActiveHref(email, phone, source string,
 		}(userId, res)
 		href = util.ObjToString(res["toDirect"])
 		//只有微信端进行账号合并
-		if token != "" {
+		if !isApp && token != "" {
 			href = fmt.Sprintf("%s?%stoDirect=%s", MergeUrl, fmt.Sprintf("token=%s&", token), href)
 		}
 	} else {
@@ -146,7 +146,7 @@ func (w *ExhibitionStruct) GetJyAdList(host, code string) (adInfo []jy.AdInfo) {
 }
 
 // AccountMerge 账号合并
-func AccountMerge(phone, email, mgoUserId string, sess *httpsession.Session, isApp bool) (token string) {
+func AccountMerge(phone, email, mgoUserId string, sess *httpsession.Session) (token string) {
 	if userinfo := Compatible.Select(mgoUserId, `{"s_unionid":1,"s_name":1,"s_nickname":1,"s_headimageurl":1,"l_registedate":1,"i_ispush":1,"i_applystatus":1,"i_sex":1,"s_country":1,"s_province":1,"s_city":1,"s_m_openid":1,"a_m_openid":1,"base_user_id":1,"s_newsource":1,"l_registedate":1}`); userinfo != nil && len(*userinfo) > 0 {
 		//新用户时间
 		onLineTime, _ := time.ParseInLocation(date.Date_Full_Layout, Sysconfig.AccountMergeOnline, time.Local)
@@ -177,7 +177,7 @@ func AccountMerge(phone, email, mgoUserId string, sess *httpsession.Session, isA
 				//用户中台存储  结束
 				jy.CreateUserMerge(MQFW, Mysql, sess, Middleground).FlushSession(mgoUserId) //刷新session
 			}
-		} else if onLineTime.Before(reg) || isApp { //新微信用户直接绑定
+		} else if onLineTime.Before(reg) { //新微信用户直接绑定
 			data := map[string]interface{}{
 				"s_unionid":      (*userinfo)["s_unionid"],
 				"s_name":         (*userinfo)["s_name"],
@@ -198,7 +198,7 @@ func AccountMerge(phone, email, mgoUserId string, sess *httpsession.Session, isA
 			}
 			if Compatible.Update(relationPhoneId, map[string]interface{}{
 				"$set": data,
-			}) && !isApp {
+			}) {
 				//用户中台存储  开始
 				if uinfo := jy.GetInfoForBaseUser(MQFW, mongodb.BsonIdToSId(relationPhoneId)); uinfo != nil {
 					jy.UpdateUser(MQFW, mongodb.BsonIdToSId(relationPhoneId), *uinfo, *Middleground)