From 4dde0436a000249d83ecb650481a6b52536741a5 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 6 May 2024 20:30:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/servers/components/waf/updateSetPopup.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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() }