From b4f02ff7d349789da21c82ea4cfaaa3028205424 Mon Sep 17 00:00:00 2001 From: yubaolee Date: Thu, 8 Sep 2016 16:20:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=A0=E9=99=A4=E6=97=B6ht?= =?UTF-8?q?tp=E6=8F=90=E4=BA=A4=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenAuth.Mvc/BllScripts/assignModuleElement.js | 1 + OpenAuth.Mvc/BllScripts/assignRes.js | 1 + OpenAuth.Mvc/BllScripts/categoryManager.js | 5 +++-- OpenAuth.Mvc/BllScripts/commonApply.js | 5 +++-- OpenAuth.Mvc/BllScripts/modulemanager.js | 5 +++-- OpenAuth.Mvc/BllScripts/orgManager.js | 5 +++-- OpenAuth.Mvc/BllScripts/resourceManager.js | 5 +++-- OpenAuth.Mvc/BllScripts/roleManager.js | 5 +++-- OpenAuth.Mvc/BllScripts/stockManager.js | 5 +++-- OpenAuth.Mvc/BllScripts/userRoleManager.js | 1 + OpenAuth.Mvc/BllScripts/usermanager.js | 7 +++++-- OpenAuth.Mvc/Controllers/BaseController.cs | 12 ++++-------- OpenAuth.Mvc/Controllers/DesignerController.cs | 2 +- .../Controllers/RoleManagerController.cs | 2 ++ OpenAuth.Mvc/Web.config | 2 +- OpenAuth.WebApi/OpenAuth.WebApi.csproj | 1 + .../Properties/PublishProfiles/webapi.pubxml | 17 +++++++++++++++++ OpenAuth.WebTest/OpenAuth.WebTest.csproj | 1 + .../Properties/PublishProfiles/webtest.pubxml | 17 +++++++++++++++++ 19 files changed, 73 insertions(+), 26 deletions(-) create mode 100644 OpenAuth.WebApi/Properties/PublishProfiles/webapi.pubxml create mode 100644 OpenAuth.WebTest/Properties/PublishProfiles/webtest.pubxml diff --git a/OpenAuth.Mvc/BllScripts/assignModuleElement.js b/OpenAuth.Mvc/BllScripts/assignModuleElement.js index aeaabcaa..c2b481b2 100644 --- a/OpenAuth.Mvc/BllScripts/assignModuleElement.js +++ b/OpenAuth.Mvc/BllScripts/assignModuleElement.js @@ -53,6 +53,7 @@ function DialogList() { var url = '/ModuleElementManager/LoadWithAccess?tId='; this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({ showToolbar: false, + loadType: 'GET', filterThead: false, target: $(this), columns: [ diff --git a/OpenAuth.Mvc/BllScripts/assignRes.js b/OpenAuth.Mvc/BllScripts/assignRes.js index cae72acf..70c7cc68 100644 --- a/OpenAuth.Mvc/BllScripts/assignRes.js +++ b/OpenAuth.Mvc/BllScripts/assignRes.js @@ -56,6 +56,7 @@ function DialogList() { var url = '/ResourceManager/LoadWithAccess?cId='; this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({ showToolbar: false, + loadType: 'GET', filterThead: false, target: $(this), columns: [ diff --git a/OpenAuth.Mvc/BllScripts/categoryManager.js b/OpenAuth.Mvc/BllScripts/categoryManager.js index 9aabca37..85d29c70 100644 --- a/OpenAuth.Mvc/BllScripts/categoryManager.js +++ b/OpenAuth.Mvc/BllScripts/categoryManager.js @@ -17,6 +17,7 @@ function MainGrid() { var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块 this.maingrid = $('#maingrid').datagrid({ showToolbar: false, + loadType: 'GET', filterThead: false, target: $(this), columns: [ @@ -234,7 +235,7 @@ function del() { var selected = list.getSelectedObj(); if (selected == null) return; - $.getJSON('/CategoryManager/Delete?Id=' + selected.Id, function (data) { + $.post('/CategoryManager/Delete?Id=' + selected.Id, function (data) { if (data.statusCode == "200") { list.reload(); ztree.reload(); @@ -242,7 +243,7 @@ function del() { else { $(this).alertmsg('warn', data.message); } - }); + }, "json"); } //编辑 diff --git a/OpenAuth.Mvc/BllScripts/commonApply.js b/OpenAuth.Mvc/BllScripts/commonApply.js index e19a3d7f..56e16402 100644 --- a/OpenAuth.Mvc/BllScripts/commonApply.js +++ b/OpenAuth.Mvc/BllScripts/commonApply.js @@ -27,6 +27,7 @@ function MainGrid() { var selectedNode = 'me'; this.maingrid = $('#maingrid').datagrid({ showToolbar: false, + loadType:'GET', filterThead: false, target: $(this), columns: [ @@ -115,14 +116,14 @@ function del() { var selected = list.getSelectedObj(); if (selected == null) return; - $.getJSON('/CommonApplies/Delete?Id=' + selected.Id, function (data) { + $.post('/CommonApplies/Delete?Id=' + selected.Id, function (data) { if (data.statusCode == "200") { list.reload(); } else { $(this).alertmsg('warn', data.message); } - }); + }, "json"); } //自定义的编辑按钮 diff --git a/OpenAuth.Mvc/BllScripts/modulemanager.js b/OpenAuth.Mvc/BllScripts/modulemanager.js index 00f00f86..1d446b8d 100644 --- a/OpenAuth.Mvc/BllScripts/modulemanager.js +++ b/OpenAuth.Mvc/BllScripts/modulemanager.js @@ -19,6 +19,7 @@ function MainGrid() { this.maingrid = $('#maingrid').datagrid({ showToolbar: false, filterThead: false, + loadType: 'GET', target: $(this), columns: [ { @@ -262,7 +263,7 @@ function del() { var selected = list.getSelectedObj(); if (selected == null) return; - $.getJSON('/moduleManager/Delete?Id=' + selected.Id, function (data) { + $.post('/moduleManager/Delete?Id=' + selected.Id, function (data) { if (data.statusCode == "200") { list.reload(); ztree.reload(); @@ -270,7 +271,7 @@ function del() { else { $(this).alertmsg('warn', data.message); } - }); + }, "json"); } //自定义的编辑按钮 diff --git a/OpenAuth.Mvc/BllScripts/orgManager.js b/OpenAuth.Mvc/BllScripts/orgManager.js index f5ea96c5..e2339046 100644 --- a/OpenAuth.Mvc/BllScripts/orgManager.js +++ b/OpenAuth.Mvc/BllScripts/orgManager.js @@ -48,6 +48,7 @@ function MainGrid() { this.maingrid = $('#maingrid').datagrid({ showToolbar: false, filterThead: false, + loadType: 'GET', target: $(this), columns: [ { @@ -236,7 +237,7 @@ function del() { var selected = list.getSelectedObj(); if (selected == null) return; - $.getJSON('/OrgManager/DelOrg?Id=' + selected.Id, function (data) { + $.post('/OrgManager/DelOrg?Id=' + selected.Id, function (data) { if (data.statusCode == "200") { list.reload(); ztree.reload(); @@ -244,7 +245,7 @@ function del() { else { $(this).alertmsg('warn', data.message); } - }); + }, "json"); } //自定义的编辑按钮 diff --git a/OpenAuth.Mvc/BllScripts/resourceManager.js b/OpenAuth.Mvc/BllScripts/resourceManager.js index 59c39ea7..bab40821 100644 --- a/OpenAuth.Mvc/BllScripts/resourceManager.js +++ b/OpenAuth.Mvc/BllScripts/resourceManager.js @@ -6,6 +6,7 @@ function MainGrid() { this.maingrid = $('#maingrid').datagrid({ showToolbar: false, filterThead: false, + loadType: 'GET', target: $(this), columns: [ { @@ -219,7 +220,7 @@ function del() { var selected = list.getSelectedObj(); if (selected == null) return; - $.getJSON('/ResourceManager/Delete?Id=' + selected.Id, function (data) { + $.post('/ResourceManager/Delete?Id=' + selected.Id, function (data) { if (data.statusCode == "200") { list.reload(); ztree.reload(); @@ -227,7 +228,7 @@ function del() { else { $(this).alertmsg('warn', data.message); } - }); + }, "json"); } //自定义的编辑按钮 diff --git a/OpenAuth.Mvc/BllScripts/roleManager.js b/OpenAuth.Mvc/BllScripts/roleManager.js index c118703b..fdf5135d 100644 --- a/OpenAuth.Mvc/BllScripts/roleManager.js +++ b/OpenAuth.Mvc/BllScripts/roleManager.js @@ -48,6 +48,7 @@ function MainGrid() { this.maingrid = $('#maingrid').datagrid({ showToolbar: false, filterThead: false, + loadType: 'GET', target: $(this), columns: [ { @@ -217,7 +218,7 @@ function del() { var selected = list.getSelectedObj(); if (selected == null) return; - $.getJSON('/RoleManager/Delete?Id=' + selected.Id, function (data) { + $.post('/RoleManager/Delete?Id=' + selected.Id, function (data) { if (data.statusCode == "200") { list.reload(); orgtree.reload(); @@ -225,7 +226,7 @@ function del() { else { $(this).alertmsg('warn', data.message); } - }); + }, "json"); } //自定义的编辑按钮 diff --git a/OpenAuth.Mvc/BllScripts/stockManager.js b/OpenAuth.Mvc/BllScripts/stockManager.js index 8e0d324e..977d0365 100644 --- a/OpenAuth.Mvc/BllScripts/stockManager.js +++ b/OpenAuth.Mvc/BllScripts/stockManager.js @@ -47,6 +47,7 @@ function MainGrid() { this.maingrid = $('#maingrid').datagrid({ showToolbar: false, filterThead: false, + loadType: 'GET', target: $(this), columns: [ { @@ -231,7 +232,7 @@ function del() { var selected = list.getSelectedObj(); if (selected == null) return; - $.getJSON('/StockManager/Delete?Id=' + selected.Id, function (data) { + $.post('/StockManager/Delete?Id=' + selected.Id, function (data) { if (data.statusCode == "200") { list.reload(); ztree.reload(); @@ -239,7 +240,7 @@ function del() { else { $(this).alertmsg('warn', data.message); } - }); + }, "json"); } //自定义的编辑按钮 diff --git a/OpenAuth.Mvc/BllScripts/userRoleManager.js b/OpenAuth.Mvc/BllScripts/userRoleManager.js index fe1584e2..da545232 100644 --- a/OpenAuth.Mvc/BllScripts/userRoleManager.js +++ b/OpenAuth.Mvc/BllScripts/userRoleManager.js @@ -43,6 +43,7 @@ function UserRolesList() { var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块 this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({ showToolbar: false, + loadType: 'GET', filterThead: false, target: $(this), columns: [ diff --git a/OpenAuth.Mvc/BllScripts/usermanager.js b/OpenAuth.Mvc/BllScripts/usermanager.js index bbc2bcba..0c849c4a 100644 --- a/OpenAuth.Mvc/BllScripts/usermanager.js +++ b/OpenAuth.Mvc/BllScripts/usermanager.js @@ -49,6 +49,7 @@ function MainGrid() { showToolbar: false, filterThead: false, target: $(this), + loadType: 'GET', columns: [ { name: 'Id', @@ -228,7 +229,7 @@ function del() { var selected = list.getSelectedObj(); if (selected == null) return; - $.getJSON('/UserManager/Delete?Id=' + selected.Id, function (data) { + $.post('/UserManager/Delete?Id=' + selected.Id, function (data) { if (data.statusCode == "200") { list.reload(); maintree.reload(); @@ -236,9 +237,11 @@ function del() { else { $(this).alertmsg('warn', data.message); } - }); + }, "json"); } + + //自定义的编辑按钮 function edit() { var selected = list.getSelectedObj(); diff --git a/OpenAuth.Mvc/Controllers/BaseController.cs b/OpenAuth.Mvc/Controllers/BaseController.cs index b2fd2308..21a7f488 100644 --- a/OpenAuth.Mvc/Controllers/BaseController.cs +++ b/OpenAuth.Mvc/Controllers/BaseController.cs @@ -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); } - + } } } \ No newline at end of file diff --git a/OpenAuth.Mvc/Controllers/DesignerController.cs b/OpenAuth.Mvc/Controllers/DesignerController.cs index 6bbe31e1..b0970de8 100644 --- a/OpenAuth.Mvc/Controllers/DesignerController.cs +++ b/OpenAuth.Mvc/Controllers/DesignerController.cs @@ -16,7 +16,7 @@ using WorkflowRuntime = OptimaJet.Workflow.Core.Runtime.WorkflowRuntime; namespace OpenAuth.Mvc.Controllers { - public class DesignerController : Controller + public class DesignerController : BaseController { public ActionResult Index(string schemeName) { diff --git a/OpenAuth.Mvc/Controllers/RoleManagerController.cs b/OpenAuth.Mvc/Controllers/RoleManagerController.cs index 3d3e3aa5..f1d3732b 100644 --- a/OpenAuth.Mvc/Controllers/RoleManagerController.cs +++ b/OpenAuth.Mvc/Controllers/RoleManagerController.cs @@ -81,12 +81,14 @@ namespace OpenAuth.Mvc.Controllers return JsonHelper.Instance.Serialize(_app.LoadForOrgAndUser(orgId, userId)); } + [System.Web.Mvc.HttpPost] public string AccessRoles(Guid userId, Guid[] ids) { _app.AccessRole(userId, ids); return JsonHelper.Instance.Serialize(BjuiResponse); } + [System.Web.Mvc.HttpPost] public string DelAccessRoles(Guid userId, Guid[] ids) { _app.DelAccessRole(userId, ids); diff --git a/OpenAuth.Mvc/Web.config b/OpenAuth.Mvc/Web.config index 660fe9d4..3e39551d 100644 --- a/OpenAuth.Mvc/Web.config +++ b/OpenAuth.Mvc/Web.config @@ -62,7 +62,7 @@ - + diff --git a/OpenAuth.WebApi/OpenAuth.WebApi.csproj b/OpenAuth.WebApi/OpenAuth.WebApi.csproj index b3d6b36f..4ae948b8 100644 --- a/OpenAuth.WebApi/OpenAuth.WebApi.csproj +++ b/OpenAuth.WebApi/OpenAuth.WebApi.csproj @@ -182,6 +182,7 @@ + diff --git a/OpenAuth.WebApi/Properties/PublishProfiles/webapi.pubxml b/OpenAuth.WebApi/Properties/PublishProfiles/webapi.pubxml new file mode 100644 index 00000000..8df495e4 --- /dev/null +++ b/OpenAuth.WebApi/Properties/PublishProfiles/webapi.pubxml @@ -0,0 +1,17 @@ + + + + + FileSystem + Release + Any CPU + + True + False + C:\Users\Administrator\Desktop\OpenAuth.WebApi + False + + \ No newline at end of file diff --git a/OpenAuth.WebTest/OpenAuth.WebTest.csproj b/OpenAuth.WebTest/OpenAuth.WebTest.csproj index faec8aa1..9591f098 100644 --- a/OpenAuth.WebTest/OpenAuth.WebTest.csproj +++ b/OpenAuth.WebTest/OpenAuth.WebTest.csproj @@ -137,6 +137,7 @@ + diff --git a/OpenAuth.WebTest/Properties/PublishProfiles/webtest.pubxml b/OpenAuth.WebTest/Properties/PublishProfiles/webtest.pubxml new file mode 100644 index 00000000..fdae6322 --- /dev/null +++ b/OpenAuth.WebTest/Properties/PublishProfiles/webtest.pubxml @@ -0,0 +1,17 @@ + + + + + FileSystem + Release + Any CPU + + True + False + C:\Users\Administrator\Desktop\OpenAuth.WebTest + False + + \ No newline at end of file