From b4f02ff7d349789da21c82ea4cfaaa3028205424 Mon Sep 17 00:00:00 2001 From: yubaolee Date: Thu, 8 Sep 2016 16:20:31 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=B6http=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 From e430b2716d53a9170e750fe4e579a07a79d0f32b Mon Sep 17 00:00:00 2001 From: yubaolee Date: Fri, 9 Sep 2016 17:51:33 +0800 Subject: [PATCH 2/4] delete demo config in web.config --- OpenAuth.Mvc/BllScripts/processDetail.js | 9 +++++++-- OpenAuth.Mvc/Controllers/CommonAppliesController.cs | 4 ++++ OpenAuth.Mvc/Web.config | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/OpenAuth.Mvc/BllScripts/processDetail.js b/OpenAuth.Mvc/BllScripts/processDetail.js index 3838492c..ac8f285b 100644 --- a/OpenAuth.Mvc/BllScripts/processDetail.js +++ b/OpenAuth.Mvc/BllScripts/processDetail.js @@ -38,8 +38,13 @@ $(function () { .on("click", function () { //执行命令 $.post("/CommonApplies/ExeCmd?id=" +$("#processId").val() +"&cmd=" +$(this).val() , function (data) { - BJUI.dialog('refresh', 'detailDlg'); - }); + if (data.statusCode == "200") { + BJUI.dialog('refresh', 'detailDlg'); + } + else { + $(this).alertmsg('warn', data.message); + } + },'json'); }); }); diff --git a/OpenAuth.Mvc/Controllers/CommonAppliesController.cs b/OpenAuth.Mvc/Controllers/CommonAppliesController.cs index ad4ad7f5..a5b544f1 100644 --- a/OpenAuth.Mvc/Controllers/CommonAppliesController.cs +++ b/OpenAuth.Mvc/Controllers/CommonAppliesController.cs @@ -13,6 +13,10 @@ using ProcessStatus = OptimaJet.Workflow.Core.Persistence.ProcessStatus; namespace OpenAuth.Mvc.Controllers { + /// + /// 通用申请流程处理 + /// 李玉宝新增于2016-09-08 19:21:59 + /// public class CommonAppliesController : BaseController { private CommonApplyApp _app; diff --git a/OpenAuth.Mvc/Web.config b/OpenAuth.Mvc/Web.config index 3e39551d..660fe9d4 100644 --- a/OpenAuth.Mvc/Web.config +++ b/OpenAuth.Mvc/Web.config @@ -62,7 +62,7 @@ - + From 56a0581fe0a9e75496a156b10c6b78b39583746f Mon Sep 17 00:00:00 2001 From: yubaolee Date: Sat, 10 Sep 2016 18:48:28 +0800 Subject: [PATCH 3/4] check issue #15 --- OpenAuth.Repository/RelevanceRepository.cs | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/OpenAuth.Repository/RelevanceRepository.cs b/OpenAuth.Repository/RelevanceRepository.cs index 96c4a96f..187413a4 100644 --- a/OpenAuth.Repository/RelevanceRepository.cs +++ b/OpenAuth.Repository/RelevanceRepository.cs @@ -1,6 +1,7 @@ using OpenAuth.Domain; using OpenAuth.Domain.Interface; using System; +using System.Collections.Generic; using System.Linq; namespace OpenAuth.Repository @@ -35,20 +36,16 @@ namespace OpenAuth.Repository /// 关联的<firstId, secondId>数组 public void AddRelevance(string key, ILookup idMaps) { - foreach (var sameVals in idMaps) - { - foreach (var value in sameVals) + DeleteBy(key, idMaps); + BatchAdd((from sameVals in idMaps + from value in sameVals + select new Relevance { - Add(new Relevance - { - Key = key, - FirstId = sameVals.Key, - SecondId = value, - OperateTime = DateTime.Now - }); - } - } - Save(); + Key = key, + FirstId = sameVals.Key, + SecondId = value, + OperateTime = DateTime.Now + }).ToArray()); } } } \ No newline at end of file From 0269a4f194e666babf0ae2d30b1f90c6d2d63e55 Mon Sep 17 00:00:00 2001 From: yubaolee Date: Sat, 10 Sep 2016 18:49:16 +0800 Subject: [PATCH 4/4] check issue #13 --- OpenAuth.WebApi/OpenAuth.WebApi.csproj | 8 ++++++++ OpenAuth.WebApi/Web.config | 10 ++++++++-- OpenAuth.WebApi/packages.config | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/OpenAuth.WebApi/OpenAuth.WebApi.csproj b/OpenAuth.WebApi/OpenAuth.WebApi.csproj index 4ae948b8..d5e4267c 100644 --- a/OpenAuth.WebApi/OpenAuth.WebApi.csproj +++ b/OpenAuth.WebApi/OpenAuth.WebApi.csproj @@ -69,6 +69,14 @@ True + + ..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll + True + + + ..\packages\MySql.Data.Entity.6.9.8\lib\net45\MySql.Data.Entity.EF6.dll + True + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True diff --git a/OpenAuth.WebApi/Web.config b/OpenAuth.WebApi/Web.config index b1a45900..cff68bd2 100644 --- a/OpenAuth.WebApi/Web.config +++ b/OpenAuth.WebApi/Web.config @@ -91,6 +91,12 @@ - + + - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/OpenAuth.WebApi/packages.config b/OpenAuth.WebApi/packages.config index 67879d50..1fc34761 100644 --- a/OpenAuth.WebApi/packages.config +++ b/OpenAuth.WebApi/packages.config @@ -27,6 +27,8 @@ + +