增加演示版本支持,在web.config中配置即可;

增加自定义出差处理,参考ErrorController
This commit is contained in:
yubaolee
2016-04-25 11:53:21 +08:00
parent 3037c3b1f6
commit 6181f9dd47
22 changed files with 182 additions and 33 deletions

View File

@@ -16,13 +16,12 @@
// </summary>
// ***********************************************************************
using Infrastructure.Helper;
using OpenAuth.App.ViewModel;
using OpenAuth.Mvc.Models;
using System;
using System.Diagnostics;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;
using OpenAuth.App;
@@ -60,6 +59,16 @@ namespace OpenAuth.Mvc.Controllers
ViewBag.Module = module; //为View显示服务主要是为了显示按钮
}
var version = ConfigurationManager.AppSettings["version"];
if (version == "demo")
{
HttpPostAttribute hobbyAttr = (HttpPostAttribute)Attribute.GetCustomAttribute(function, typeof(HttpPostAttribute));
if (actionname.Contains("del") || hobbyAttr != null) //客户端提交数据
{
throw new HttpException(400, "演示版本,不能进行该操作,当前模块:" + controllername +"/" +actionname);
}
}
base.OnActionExecuting(filterContext);
}
}