优化
This commit is contained in:
parent
3ec456db01
commit
69fbe8d12c
@ -15,19 +15,24 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
|
||||
rsp := &pb.SysFuncGetListResp{}
|
||||
rsp.Cond = make(map[string]int32, 0)
|
||||
|
||||
list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId())
|
||||
if len(req.Keys) == 0 {
|
||||
confList := this.module.configure.getOpencondList()
|
||||
for _, v := range confList {
|
||||
if v.ActivateType == 0 {
|
||||
id := this.module.modelSys.validCond(session.GetUserId(), v)
|
||||
if id != "" {
|
||||
|
||||
id := this.module.modelSys.validCond(session.GetUserId(), v)
|
||||
if id != "" {
|
||||
if v.ActivateType == 1 {
|
||||
if _, ok := list.Cond[id]; ok {
|
||||
rsp.Cond[id] = 1
|
||||
} else {
|
||||
rsp.Cond[id] = 0
|
||||
}
|
||||
} else {
|
||||
rsp.Cond[id] = 1
|
||||
}
|
||||
|
||||
} else {
|
||||
rsp.Cond[v.Id] = 0
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
for _, key := range req.Keys {
|
||||
@ -36,22 +41,22 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
continue
|
||||
}
|
||||
if conf, ok := opencfg.GetDataMap()[key]; ok {
|
||||
if conf.ActivateType == 0 {
|
||||
id := this.module.modelSys.validCond(session.GetUserId(), conf)
|
||||
if id != "" {
|
||||
id := this.module.modelSys.validCond(session.GetUserId(), conf)
|
||||
if id != "" {
|
||||
if conf.ActivateType == 1 {
|
||||
if _, ok := list.Cond[id]; ok {
|
||||
rsp.Cond[id] = 1
|
||||
} else {
|
||||
rsp.Cond[id] = 0
|
||||
}
|
||||
} else {
|
||||
rsp.Cond[id] = 1
|
||||
}
|
||||
} else {
|
||||
rsp.Cond[conf.Id] = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId())
|
||||
for k, v := range list.Cond {
|
||||
rsp.Cond[k] = v
|
||||
}
|
||||
if err := session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp); err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user