|
@@ -66,6 +66,9 @@ func (s *allowAndDenyIpService) AddAllowAndDenyIps(ctx context.Context, req v1.A
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+ if len(gatewayGroupIps) == 0 {
|
|
|
+ return fmt.Errorf("请先配置实例")
|
|
|
+ }
|
|
|
|
|
|
color := "black"
|
|
|
if req.AllowOrDeny == 1 {
|
|
@@ -99,6 +102,12 @@ func (s *allowAndDenyIpService) EditAllowAndDenyIps(ctx context.Context, req v1.
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+
|
|
|
+ if len(gatewayGroupIps) == 0 {
|
|
|
+ return fmt.Errorf("请先配置实例")
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
color := "black"
|
|
|
if req.AllowOrDeny == 1 {
|
|
|
color = "white"
|
|
@@ -138,6 +147,12 @@ func (s *allowAndDenyIpService) DeleteAllowAndDenyIps(ctx context.Context, req v
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+
|
|
|
+ if len(gatewayGroupIps) == 0 {
|
|
|
+ return fmt.Errorf("请先配置实例")
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
ip, err := s.GetAllowAndDenyIp(ctx, int64(id))
|
|
|
if err != nil {
|
|
|
return err
|