自动激活 和手动激活数据校验

This commit is contained in:
meixiongfeng 2023-04-03 16:05:19 +08:00
parent 4456644096
commit 142ff089aa

View File

@ -29,12 +29,21 @@ func (this *ModelSys) Init(service core.IService, module core.IModule, comp core
func (this *ModelSys) IsAccess(funName string, uid string) (code pb.ErrorCode) {
user := this.moduleSys.ModuleUser.GetUser(uid)
if user != nil {
conf := this.moduleSys.configure.getFuncCfg(funName)
if conf != nil {
this.validCond(uid, conf)
if conf := this.moduleSys.configure.getFuncCfg(funName); conf != nil {
if conf.ActivateType == 1 { // 已经手动激活过
list, _ := this.GetOpenCondList(uid)
if v, ok := list.Cond[funName]; ok && v == 1 {
return
}
} else {
if id := this.validCond(uid, conf); id != "" { // 条件满足已经激活
return
}
}
}
}
code = pb.ErrorCode_OpenCondErr
return
}