Commit e74c79f2 by 泽锋 李

优化api 的免登陆

parent 3818b6fd
...@@ -33,6 +33,10 @@ namespace AutoTurnOver.Models ...@@ -33,6 +33,10 @@ namespace AutoTurnOver.Models
isDefined = controllerActionDescriptor.MethodInfo.GetCustomAttributes(inherit: true) isDefined = controllerActionDescriptor.MethodInfo.GetCustomAttributes(inherit: true)
.Any(a => a.GetType().Equals(typeof(NoLoginAttribute))); .Any(a => a.GetType().Equals(typeof(NoLoginAttribute)));
} }
if (!isDefined)
{
isDefined = controllerActionDescriptor.ControllerTypeInfo.GetCustomAttributes(inherit: true).Any(a => a.GetType().Equals(typeof(NoLoginAttribute)));
}
if (isDefined) return; if (isDefined) return;
string token = context.Request.Headers["Authorization"]; string token = context.Request.Headers["Authorization"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment