net core 忽略过滤器
/// <summary> /// 排除Token检测Filter /// </summary> [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] public class ExcludeTokenFilterAttribute : Attribute { }
var actionDescriptor = context.ActionDescriptor as ControllerActionDescriptor; //是否存在ExcludeToken特性 0-否 1-是 var excludeTokenAttr = actionDescriptor.EndpointMetadata.OfType<ExcludeTokenFilterAttribute>().Count(); if (excludeTokenAttr == 0) {
}