mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-06 13:27:43 +08:00
fix: 解决防火墙多端口创建失败的问题 (#1988)
This commit is contained in:
parent
da8a06909b
commit
f8f231253d
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue