mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
fix: 解决防火墙多端口创建失败的问题 (#1988)
This commit is contained in:
parent
27bd4a63ef
commit
cb1b6742d4
@ -190,6 +190,7 @@ func (u *FirewallService) OperatePortRule(req dto.PortRuleOperate, reload bool)
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemPorts := req.Port
|
||||||
for _, proto := range protos {
|
for _, proto := range protos {
|
||||||
if strings.Contains(req.Port, "-") {
|
if strings.Contains(req.Port, "-") {
|
||||||
req.Protocol = proto
|
req.Protocol = proto
|
||||||
@ -197,7 +198,7 @@ func (u *FirewallService) OperatePortRule(req dto.PortRuleOperate, reload bool)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ports := strings.Split(req.Port, ",")
|
ports := strings.Split(itemPorts, ",")
|
||||||
for _, port := range ports {
|
for _, port := range ports {
|
||||||
if len(port) == 0 {
|
if len(port) == 0 {
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user