diff --git a/internal/web/actions/default/servers/components/waf/updateSetPopup.go b/internal/web/actions/default/servers/components/waf/updateSetPopup.go index 1ccbd34d..d3560d3d 100644 --- a/internal/web/actions/default/servers/components/waf/updateSetPopup.go +++ b/internal/web/actions/default/servers/components/waf/updateSetPopup.go @@ -118,6 +118,7 @@ func (this *UpdateSetPopupAction) RunPost(params struct { if len(params.RulesJSON) == 0 { this.Fail("请添加至少一个规则") + return } var rules = []*firewallconfigs.HTTPFirewallRule{} err = json.Unmarshal(params.RulesJSON, &rules) @@ -127,6 +128,7 @@ func (this *UpdateSetPopupAction) RunPost(params struct { } if len(rules) == 0 { this.Fail("请添加至少一个规则") + return } var actionConfigs = []*firewallconfigs.HTTPFirewallActionConfig{} @@ -139,6 +141,7 @@ func (this *UpdateSetPopupAction) RunPost(params struct { } if len(actionConfigs) == 0 { this.Fail("请添加至少一个动作") + return } setConfig.Name = params.Name @@ -158,10 +161,6 @@ func (this *UpdateSetPopupAction) RunPost(params struct { this.ErrorPage(err) return } - if err != nil { - this.ErrorPage(err) - return - } this.Success() }