mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-06-11 04:47:50 +08:00
【新增】新增客户端IP限流模块。
This commit is contained in:
@@ -99,6 +99,8 @@ namespace CoreCms.Net.Web.Admin
|
||||
services.AddHttpClient();
|
||||
services.AddSingleton<WeChat.Service.HttpClients.IWeChatApiHttpClientFactory, WeChat.Service.HttpClients.WeChatApiHttpClientFactory>();
|
||||
|
||||
//启用客户端IP限制速率
|
||||
services.AddIpPolicyRateLimitSetup(Configuration);
|
||||
|
||||
//Swagger接口文档注入
|
||||
services.AddAdminSwaggerSetup();
|
||||
@@ -171,6 +173,8 @@ namespace CoreCms.Net.Web.Admin
|
||||
/// <param name="env"></param>
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
// 开启Ip限流
|
||||
app.UseIpLimitMiddle();
|
||||
// 记录请求与返回数据 (注意开启权限,不然本地无法写入)
|
||||
app.UseRequestResponseLog();
|
||||
// 用户访问记录(必须放到外层,不然如果遇到异常,会报错,因为不能返回流)(注意开启权限,不然本地无法写入)
|
||||
|
||||
Reference in New Issue
Block a user