mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 18:47:55 +08:00
增加演示版本支持,在web.config中配置即可;
增加自定义出差处理,参考ErrorController
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user