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) 
            {
       }

 

posted @ 2021-04-09 10:43  向萧  阅读(418)  评论(0编辑  收藏  举报