public class AuthFilterAttribute : ActionFilterAttribute { /// <summary> /// Action执行前处理 /// </summary> /// <param name="actionContext"></param> public override void OnActionExecuting(HttpActionContext actionContext) { HttpContextBase context = (HttpContextBase)actionContext.Request.Properties["MS_HttpContext"];//获取传统context HttpRequestBase request = context.Request;//定义传统request对象 string name = request.Params["name"]; base.OnActionExecuting(actionContext); } }
时间: 2024-10-27 13:52:16