修复服务访问控制页面可能空白的问题

This commit is contained in:
刘祥超
2022-08-30 11:42:40 +08:00
parent 316e793b1e
commit d2ecb01358

View File

@@ -36,18 +36,20 @@ func (this *IndexAction) RunGet(params struct {
allTypes = append(allTypes, def.Code)
}
var refs = webConfig.Auth.PolicyRefs
var realRefs = []*serverconfigs.HTTPAuthPolicyRef{}
for _, ref := range refs {
if ref.AuthPolicy == nil {
continue
if webConfig.Auth != nil {
var refs = webConfig.Auth.PolicyRefs
var realRefs = []*serverconfigs.HTTPAuthPolicyRef{}
for _, ref := range refs {
if ref.AuthPolicy == nil {
continue
}
if !lists.ContainsString(allTypes, ref.AuthPolicy.Type) {
continue
}
realRefs = append(realRefs, ref)
}
if !lists.ContainsString(allTypes, ref.AuthPolicy.Type) {
continue
}
realRefs = append(realRefs, ref)
webConfig.Auth.PolicyRefs = realRefs
}
webConfig.Auth.PolicyRefs = realRefs
this.Data["authConfig"] = webConfig.Auth