Pārlūkot izejas kodu

fix(webforwarding): 修复 IP 黑白名单处理逻辑

- 修正了白名单 IP 处理函数的参数顺序
-修正了黑名单 IP 处理函数的参数顺序
fusu 1 mēnesi atpakaļ
vecāks
revīzija
52f3707926
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      internal/service/webforwarding.go

+ 2 - 2
internal/service/webforwarding.go

@@ -549,7 +549,7 @@ func (s *webForwardingService) EditWebForwarding(ctx context.Context, req *v1.We
 	}
 
 	//白名单IP
-	addedAllowIps, removedAllowIps := s.WashDifferentIp(ipData.AllowIpList, req.WebForwardingData.AllowIpList)
+	addedAllowIps, removedAllowIps := s.WashDifferentIp(req.WebForwardingData.AllowIpList, ipData.AllowIpList)
 	for _, v := range require.GatewayIps {
 		if len(addedAllowIps) > 0 {
 			go s.wafformatter.PublishIpWhitelistTask(addedAllowIps, "add",v,"white")
@@ -560,7 +560,7 @@ func (s *webForwardingService) EditWebForwarding(ctx context.Context, req *v1.We
 	}
 
 	// 黑名单IP
-	addedDenyIps, removedDenyIps := s.WashDifferentIp(ipData.DenyIpList, req.WebForwardingData.DenyIpList)
+	addedDenyIps, removedDenyIps := s.WashDifferentIp(req.WebForwardingData.DenyIpList, ipData.DenyIpList)
 	for _, v := range require.GatewayIps {
 		if len(addedDenyIps) > 0 {
 			go s.wafformatter.PublishIpWhitelistTask(addedDenyIps, "add",v,"black")