调整删除时http提交方式

This commit is contained in:
yubaolee
2016-09-08 16:20:31 +08:00
parent f59c033cd5
commit b4f02ff7d3
19 changed files with 73 additions and 26 deletions

View File

@@ -34,7 +34,7 @@ namespace OpenAuth.Mvc.Controllers
{
base.OnActionExecuting(filterContext);
if (!AuthUtil.CheckLogin()) return;
if (!AuthUtil.CheckLogin()) return;
var controllername = Request.RequestContext.RouteData.Values["controller"].ToString().ToLower();
var actionname = filterContext.ActionDescriptor.ActionName.ToLower();
@@ -57,15 +57,11 @@ namespace OpenAuth.Mvc.Controllers
}
var version = ConfigurationManager.AppSettings["version"];
if (version == "demo")
if (version == "demo" && Request.HttpMethod == "POST")
{
HttpPostAttribute hobbyAttr = (HttpPostAttribute)Attribute.GetCustomAttribute(function, typeof(HttpPostAttribute));
if (actionname.Contains("del") || hobbyAttr != null) //客户端提交数据
{
throw new HttpException(400, "演示版本,不能进行该操作,当前模块:" + controllername +"/" +actionname);
}
throw new HttpException(400, "演示版本,不能进行该操作,当前模块:" + controllername + "/" + actionname);
}
}
}
}