public override void OnActionExecuting(ActionExecutingContext filterContext) { if (filterContext == null) { throw new ArgumentNullException("filterContext"); } if (filterContext.ActionDescriptor.IsDefined(typeof(AllowAnonymousAttribute), true) || filterContext.ActionDescriptor.ControllerDescriptor.IsDefined(typeof(AllowAnonymousAttribute), true)) { return; } var context = filterContext.HttpContext.ApplicationInstance.Context; if (!IsLogin(context.Request, context.Response)) { RedirectToLogin(filterContext, context); return; } //复杂验证逻辑 _contextInfo = new FilterContextInfo(filterContext); if (!IsAllowAccess(context.Request, context.Response, _contextInfo)) { RedirectToNoAccess(filterContext, context); return; } base.OnActionExecuting(filterContext); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { if (filterContext == null) throw new ArgumentNullException("filterContext"); if (filterContext.ActionDescriptor.IsDefined(typeof(AllowAnonymousAttribute), true) || filterContext.ActionDescriptor.ControllerDescriptor.IsDefined(typeof(AllowAnonymousAttribute), true)) return; var context = filterContext.HttpContext.ApplicationInstance.Context; if (!IsLogin(context.Request, context.Response)) { RedirectToLogin(filterContext, context); return; } //复杂验证逻辑 _contextInfo = new FilterContextInfo(filterContext); if (!IsAllowAccess(context.Request, context.Response, _contextInfo)) { RedirectToNoAccess(filterContext, context); return; } base.OnActionExecuting(filterContext); }
private bool IsAllowAccess(HttpRequest request, HttpResponse response, FilterContextInfo contextInfo) { return(true); }
private bool IsAllowAccess(HttpRequest request, HttpResponse response, FilterContextInfo contextInfo) { return true; }