From a60bbac8f43078c27c7f15f4094c6eccda9a164a Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 12 Sep 2023 11:53:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=AD=A6=E5=AE=98=E6=9F=B1?= =?UTF-8?q?=E5=AD=90=E8=A7=A3=E9=94=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/practice/module.go | 21 ++++++++++++++------- modules/user/model_session.go | 4 +++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/modules/practice/module.go b/modules/practice/module.go index 4a9168695..cbd61ed69 100644 --- a/modules/practice/module.go +++ b/modules/practice/module.go @@ -211,18 +211,22 @@ func (this *Practice) OpenCmdNotice(uid string, keys ...string) { ) if !this.IsCross() { for _, v := range keys { - err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), - comm.Service_Worker, string(comm.RPC_ModulePracticeUnLockPillar), - &pb.RPCGeneralReqA2{Param1: uid, Param2: v}, &pb.EmptyResp{}) - if err != nil { - this.Errorln(err) - return + if v == "practice_ pillar1" || v == "practice_ pillar2" || v == "practice_ pillar3" { + err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), + comm.Service_Worker, string(comm.RPC_ModulePracticeUnLockPillar), + &pb.RPCGeneralReqA2{Param1: uid, Param2: v}, &pb.EmptyResp{}) + if err != nil { + this.Errorln(err) + return + } } } } else { for _, v := range keys { - this.RPC_ModulePracticeUnLockPillar(context.Background(), &pb.RPCGeneralReqA2{Param1: uid, Param2: v}, &pb.EmptyResp{}) + if v == "practice_ pillar1" || v == "practice_ pillar2" || v == "practice_ pillar3" { + this.RPC_ModulePracticeUnLockPillar(context.Background(), &pb.RPCGeneralReqA2{Param1: uid, Param2: v}, &pb.EmptyResp{}) + } } } } @@ -383,7 +387,10 @@ func (this *Practice) RPC_ModulePracticeUnLockPillar(ctx context.Context, args * }) this.atlas.CheckActivatePandaAtlasCollect(args.Param1, "100001") break + default: + return } + _session, _ := this.GetUserSession(args.Param1) go this.ModuleBuried.TriggerBuried(_session, comm.GetBuriedParam(comm.Rtype152, 1)) return diff --git a/modules/user/model_session.go b/modules/user/model_session.go index 26a895462..d051af33a 100644 --- a/modules/user/model_session.go +++ b/modules/user/model_session.go @@ -33,7 +33,9 @@ func (this *ModelSession) Start() (err error) { // 获取用户 func (this *ModelSession) getUserSession(uid string) (user *pb.CacheUser) { - user = &pb.CacheUser{} + user = &pb.CacheUser{ + Uid: uid, + } if err := this.GetListObj(comm.RDS_EMPTY, uid, user); err != nil { if err != mongo.ErrNoDocuments { this.module.Errorln(err)