对于Methods添加[AllowAnonymous]可以进行匿名访问,但是对于Controller添加时无效 public class AuthAttribute : AuthorizationFilterAttribute { public override void OnAuthorization(HttpActionContext actionContext) { //如果用户方位的Action带有AllowAnonymousAttribute,则不进行授权验证,但是controller…