diff --git a/backend/app/service/firewall.go b/backend/app/service/firewall.go index 9db180c56..e00e832fa 100644 --- a/backend/app/service/firewall.go +++ b/backend/app/service/firewall.go @@ -207,6 +207,7 @@ func (u *FirewallService) OperatePortRule(req dto.PortRuleOperate, reload bool) return nil } + itemPorts := req.Port for _, proto := range protos { if strings.Contains(req.Port, "-") { req.Protocol = proto @@ -215,7 +216,7 @@ func (u *FirewallService) OperatePortRule(req dto.PortRuleOperate, reload bool) } _ = u.addPortRecord(req) } else { - ports := strings.Split(req.Port, ",") + ports := strings.Split(itemPorts, ",") for _, port := range ports { if len(port) == 0 { continue