fix: 解决防火墙多端口创建失败的问题 (#1988)

pull/1991/head
ssongliu 1 year ago committed by GitHub
parent da8a06909b
commit f8f231253d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save