条件开启

This commit is contained in:
meixiongfeng 2023-04-10 16:48:44 +08:00
parent afd86b95b0
commit edeffa6e88

View File

@ -19,10 +19,15 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
if len(req.Keys) == 0 { if len(req.Keys) == 0 {
confList := this.module.configure.getOpencondList() confList := this.module.configure.getOpencondList()
for _, v := range confList { for _, v := range confList {
if v.ActivateType == 0 {
id := this.module.modelSys.validCond(session.GetUserId(), v) id := this.module.modelSys.validCond(session.GetUserId(), v)
if id != "" { if id != "" {
rsp.Cond[id] = 1 rsp.Cond[id] = 1
} }
} else {
rsp.Cond[v.Id] = 0
}
} }
} else { } else {
for _, key := range req.Keys { for _, key := range req.Keys {
@ -31,19 +36,21 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
continue continue
} }
if conf, ok := opencfg.GetDataMap()[key]; ok { if conf, ok := opencfg.GetDataMap()[key]; ok {
if conf.ActivateType == 0 {
id := this.module.modelSys.validCond(session.GetUserId(), conf) id := this.module.modelSys.validCond(session.GetUserId(), conf)
if id != "" { if id != "" {
rsp.Cond[id] = 1 rsp.Cond[id] = 1
} }
} else {
rsp.Cond[conf.Id] = 0
}
} }
} }
} }
list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId()) list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId())
for k, v := range list.Cond { for k, v := range list.Cond {
//if _, ok := rsp.Cond[k]; ok {
rsp.Cond[k] = v rsp.Cond[k] = v
//}
} }
if err := session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp); err != nil { if err := session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp); err != nil {
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError