|  | @@ -27,19 +27,17 @@ namespace Admin.Core.Extensions
 | 
											
												
													
														|  |                  //redis
 |  |                  //redis
 | 
											
												
													
														|  |                  var redisRateLimit = new CSRedis.CSRedisClient(cacheConfig.Redis.ConnectionStringRateLimit);
 |  |                  var redisRateLimit = new CSRedis.CSRedisClient(cacheConfig.Redis.ConnectionStringRateLimit);
 | 
											
												
													
														|  |                  services.AddSingleton<IDistributedCache>(new CSRedisCache(redisRateLimit));
 |  |                  services.AddSingleton<IDistributedCache>(new CSRedisCache(redisRateLimit));
 | 
											
												
													
														|  | -                services.AddSingleton<IIpPolicyStore, DistributedCacheIpPolicyStore>();
 |  | 
 | 
											
												
													
														|  | -                services.AddSingleton<IRateLimitCounterStore, DistributedCacheRateLimitCounterStore>();
 |  | 
 | 
											
												
													
														|  | 
 |  | +                services.AddDistributedRateLimiting();
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |              else
 |  |              else
 | 
											
												
													
														|  |              {
 |  |              {
 | 
											
												
													
														|  |                  //内存
 |  |                  //内存
 | 
											
												
													
														|  |                  services.AddMemoryCache();
 |  |                  services.AddMemoryCache();
 | 
											
												
													
														|  | -                services.AddSingleton<IIpPolicyStore, MemoryCacheIpPolicyStore>();
 |  | 
 | 
											
												
													
														|  | -                services.AddSingleton<IRateLimitCounterStore, MemoryCacheRateLimitCounterStore>();
 |  | 
 | 
											
												
													
														|  | 
 |  | +                services.AddInMemoryRateLimiting();
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |              services.AddSingleton<IRateLimitConfiguration, RateLimitConfiguration>();
 |  |              services.AddSingleton<IRateLimitConfiguration, RateLimitConfiguration>();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |              #endregion IP限流
 |  |              #endregion IP限流
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | -}
 |  | 
 | 
											
												
													
														|  | 
 |  | +}
 |