.net mvc 过滤器获取当前action

//判断用户是否在系统中,如果不在,跳转到NoAccess页面
var attrs = filterContext.ActionDescriptor.GetCustomAttributes(true);
if (attrs.Any(c => c.GetType() == typeof(AllowAnonymousAttribute)))
{
	return;
}
posted @ 2025-03-05 15:58  暖暖De幸福  阅读(5)  评论(0)    收藏  举报