wangchuanjin 2 年之前
父节点
当前提交
9dd45f223f
共有 1 个文件被更改,包括 5 次插入19 次删除
  1. 5 19
      src/jfw/front/front.go

+ 5 - 19
src/jfw/front/front.go

@@ -1,7 +1,6 @@
 package front
 
 import (
-	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
 	"fmt"
 	"jy/src/jfw/config"
 	"jy/src/jfw/jyutil"
@@ -17,6 +16,8 @@ import (
 	"sync"
 	"time"
 
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
+
 	util "app.yhyue.com/moapp/jybase/common"
 	. "app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/encrypt"
@@ -870,39 +871,23 @@ func (m *Front) Sess(ostr string) error {
 		userFlag := str[0]
 		ok := false
 		var identity *pb.Identity
-
 		if str[1] == "userId" || str[1] == "entUserId" || str[1] == "positionId" {
-
 			if str[1] == "userId" {
-
 				identity = config.Middleground.UserCenter.IdentityByUserId(util.Int64All(userFlag))
-
 			} else if str[1] == "entUserId" {
-
 				identity = config.Middleground.UserCenter.IdentityByEntUserId(util.Int64All(userFlag))
-
 			} else if str[1] == "positionId" {
-
 				identity = config.Middleground.UserCenter.IdentityByPositionId(util.Int64All(userFlag))
-
 			}
-
 			if identity != nil {
-
 				ok, _, _ = FindUserAndCreateSessByBaseUserId(identity.UserId, m.Session(), false)
-
 			}
 		} else {
 			if str[1] == "_id" {
-
 				ok, _, _ = FindUserAndCreateSessById(mgdb.StringTOBsonId(userFlag), m.Session(), false)
-
 			} else {
-
 				ok, _, _ = FindUserAndCreateSess(userFlag, m.Session(), "wx", false)
-
 			}
-
 			identity = config.Middleground.UserCenter.IdentityByUserId(util.Int64All(m.GetSession("base_user_id")))
 		}
 		ok = ok && NewIdentityInfo(identity).Switch(m.Session())
@@ -916,14 +901,15 @@ func (m *Front) Sess(ostr string) error {
 				if len(strs) > 2 {
 					var entUserId int64
 					if strings.HasPrefix(strs[2], "V20221215-") {
+						entParams := strings.Split(sewx.Decode4HexByCheck(strings.TrimPrefix(strs[2], "V20221215-")), "_")
+						entUserId = util.Int64All(entParams[1])
+					} else {
 						entParams := strings.Split(sewx.DecodeString(strs[2]), "_")
 						entUserId = util.Int64All(entParams[1])
-
 					}
 					if identity := config.Middleground.UserCenter.IdentityByEntUserId(entUserId); identity != nil {
 						NewIdentityInfo(identity).Switch(m.Session())
 					}
-
 				}
 			} else {
 				actionurl = util.ObjToString(urlMap[str[3]])