Bläddra i källkod

微信获取openid失败处理

WH01243 1 år sedan
förälder
incheckning
573bf7ffed
1 ändrade filer med 6 tillägg och 1 borttagningar
  1. 6 1
      src/jfw/front/front.go

+ 6 - 1
src/jfw/front/front.go

@@ -886,6 +886,7 @@ func (m *Front) Sess(ostr string) error {
 			ok = true
 			ok = true
 		} else {
 		} else {
 			var identity *pb.Identity
 			var identity *pb.Identity
+
 			if str[1] == "userId" || str[1] == "entUserId" || str[1] == "positionId" {
 			if str[1] == "userId" || str[1] == "entUserId" || str[1] == "positionId" {
 				if str[1] == "userId" {
 				if str[1] == "userId" {
 					identity = config.Middleground.UserCenter.IdentityByUserId(util.Int64All(userFlag))
 					identity = config.Middleground.UserCenter.IdentityByUserId(util.Int64All(userFlag))
@@ -905,7 +906,11 @@ func (m *Front) Sess(ostr string) error {
 					if m.GetSession("positionId") != nil {
 					if m.GetSession("positionId") != nil {
 						hasIdentity = true
 						hasIdentity = true
 					}
 					}
-					ok, _, _ = FindUserAndCreateSess(userFlag, m.Session(), "wx", false, !hasIdentity)
+					if userFlag == "" && m.GetSession("positionId") != nil {
+						ok = true
+					} else {
+						ok, _, _ = FindUserAndCreateSess(userFlag, m.Session(), "wx", false, !hasIdentity)
+					}
 				}
 				}
 				if !hasIdentity {
 				if !hasIdentity {
 					identity = config.Middleground.UserCenter.IdentityByUserId(util.Int64All(m.GetSession("base_user_id")))
 					identity = config.Middleground.UserCenter.IdentityByUserId(util.Int64All(m.GetSession("base_user_id")))