mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 16:00:51 +00:00
fix: 解决防火墙多端口创建失败的问题 (#1988)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user