|
@@ -446,10 +446,7 @@ func (s *webForwardingService) EditWebForwarding(ctx context.Context, req *v1.We
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- gatewayIps, firstIp, err := s.wafformatter.GetIp(ctx, webData.WafGatewayGroupId)
|
|
|
- if err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
+
|
|
|
// 异步任务:将域名添加到白名单
|
|
|
if webData.Domain != req.WebForwardingData.Domain {
|
|
|
|
|
@@ -461,8 +458,11 @@ func (s *webForwardingService) EditWebForwarding(ctx context.Context, req *v1.We
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- go s.wafformatter.PublishDomainWhitelistTask(oldDomain, firstIp, "del")
|
|
|
- go s.wafformatter.PublishDomainWhitelistTask(doMain, firstIp, "add")
|
|
|
+ if len(require.GatewayIps) == 0 {
|
|
|
+ return fmt.Errorf("网关组不存在")
|
|
|
+ }
|
|
|
+ go s.wafformatter.PublishDomainWhitelistTask(oldDomain, require.GatewayIps[0], "del")
|
|
|
+ go s.wafformatter.PublishDomainWhitelistTask(doMain, require.GatewayIps[0], "add")
|
|
|
}
|
|
|
|
|
|
// IP过白
|
|
@@ -512,7 +512,7 @@ func (s *webForwardingService) EditWebForwarding(ctx context.Context, req *v1.We
|
|
|
}
|
|
|
}
|
|
|
addedAllowIps, removedAllowIps := s.wafformatter.findIpDifferences(oldAllowIps, newAllowIps)
|
|
|
- for _, v := range gatewayIps {
|
|
|
+ for _, v := range require.GatewayIps {
|
|
|
if len(addedAllowIps) > 0 {
|
|
|
go s.wafformatter.PublishIpWhitelistTask(addedAllowIps, "add",v)
|
|
|
}
|