From c4539c86d1f1862c5705eeed7c265ed7f35b3d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Tue, 16 Jul 2024 13:54:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AEip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WebApi/Filter/Auth/ManageAuthAttribute.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Infrastructure/Hncore.Infrastructure/WebApi/Filter/Auth/ManageAuthAttribute.cs b/Infrastructure/Hncore.Infrastructure/WebApi/Filter/Auth/ManageAuthAttribute.cs index addf4e9..dfe62f7 100644 --- a/Infrastructure/Hncore.Infrastructure/WebApi/Filter/Auth/ManageAuthAttribute.cs +++ b/Infrastructure/Hncore.Infrastructure/WebApi/Filter/Auth/ManageAuthAttribute.cs @@ -33,18 +33,18 @@ namespace Hncore.Infrastructure.WebApi context.Reject(); } - // var IP = context.HttpContext.Request.Headers["X-Real-IP"].ToString(); - // System.IO.StreamReader reader = new System.IO.StreamReader("/var/www/ip/ip"); - // string limitIp = reader.ReadLine(); + var IP = context.HttpContext.Request.Headers["X-Real-IP"].ToString(); + System.IO.StreamReader reader = new System.IO.StreamReader("/var/www/ip/ip"); + string limitIp = reader.ReadLine(); - // // //LogHelper.Error("ipaddresses", (!limitIp.Contains(IP)).ToString()); + // //LogHelper.Error("ipaddresses", (!limitIp.Contains(IP)).ToString()); - // if ((!limitIp.Contains(IP)) && manager_user_info.OperaterId<100000) { - // context.Reject(); - // } + if ((!limitIp.Contains(IP)) && manager_user_info.OperaterId<100000) { + context.Reject(); + } context.SetPassed("ManageAuth"); }