فهرست منبع

wip:融创筛选

wangshan 1 سال پیش
والد
کامیت
b7e7400a36

+ 8 - 8
jyBXCore/api/internal/logic/searchListLogic.go

@@ -38,13 +38,13 @@ func (l *SearchListLogic) SearchList(req *types.SearchReq) (resp *types.CommonRe
 	defer common.Catch()
 	t := time.Now()
 	limitFlag, isNew := util.GetFlag(l.r, l.w, req.UserId)
-	var (
-		mobileTag = []string{}
-	)
-	//工作台内
-	if strings.Contains(l.r.Referer(), "BI") {
-		mobileTag = req.MobileTag
-	}
+	//var (
+	//	mobileTag = []string{}
+	//)
+	////工作台内
+	//if strings.Contains(l.r.Referer(), "BI") {
+	//	mobileTag = req.MobileTag
+	//}
 	res, err := l.svcCtx.BxCore.GetSearchList(l.ctx, &bxcore.SearchReq{
 		AppId:           req.AppId,
 		UserId:          req.UserId,
@@ -92,7 +92,7 @@ func (l *SearchListLogic) SearchList(req *types.SearchReq) (resp *types.CommonRe
 		Period:          req.Period,
 		ChangeHand:      int64(req.ChangeHand),
 		Scale:           req.Scale,
-		MobileTag:       mobileTag,
+		MobileTag:       req.MobileTag,
 		UserAgent:       l.r.UserAgent(),
 	})
 

+ 1 - 1
jyBXCore/rpc/internal/logic/getsearchlistlogic.go

@@ -69,7 +69,7 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
 		//
 		in.SelectType = strings.Join(selectType, ",")
 	}
-	isWhite, _ := service.IsOnTheWhitelist(in.UserId)
+	isWhite, _ := service.IsOnTheWhitelist(in.UserId, in.MgoUserId)
 	//模糊检索数重新格式化
 	nin := &bxcore.SearchReq{
 		AppId:           in.AppId,

+ 5 - 1
jyBXCore/rpc/service/search.go

@@ -255,8 +255,12 @@ func SubscribeSearch(searchCode string, powerCheck *pb.CheckResp) []*bxcore.Sear
 }
 
 // IsOnTheWhitelist 是否在白名单
-func IsOnTheWhitelist(userId string) (flag bool, err error) {
+func IsOnTheWhitelist(userId, mgoUserId string) (flag bool, err error) {
 	// 	mongoid 在白名单中没有查到 再去查职位id有没有在白名单里面
+	flag, err = redis.Exists(entity.RedisPoly, fmt.Sprintf(entity.WhitelistRedisKey, mgoUserId))
+	if err == nil && flag {
+		return
+	}
 	flag, err = redis.Exists(entity.RedisPoly, fmt.Sprintf(entity.WhitelistRedisKey, userId))
 	return
 }