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"); }