From 25cbf6e31f386007f530103b26faf55a27d7fd27 Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 24 Dec 2021 20:36:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E8=AF=95cms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LR_OAModule/Controllers/NewsController.cs | 21 ++++++++++--------- .../XmlConfig/system.config | 4 ++-- .../Learun.Application.OA/News/NewsEntity.cs | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NewsController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NewsController.cs index 5890ce8dd..4726ab670 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NewsController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NewsController.cs @@ -95,9 +95,9 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers if (entity.IsSend == "1") { //获取配置文件 - string siteId = HttpUtility.UrlEncode(ConfigurationManager.AppSettings["SiteId"]); - string channelId = HttpUtility.UrlEncode(ConfigurationManager.AppSettings["ChannelId"]); - string ApiKey = HttpUtility.UrlEncode(ConfigurationManager.AppSettings["ApiKey"]); + string siteId = ConfigurationManager.AppSettings["SiteId"]; + string channelId = ConfigurationManager.AppSettings["ChannelId"]; + string ApiKey = ConfigurationManager.AppSettings["ApiKey"]; SemdNewList SendNew = new SemdNewList { Title = entity.F_FullHead, @@ -110,10 +110,10 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers AddUserName = entity.F_CreateUserName, }; WebHeaderCollection ApiId = new WebHeaderCollection - { - { "X-SS-API-KEY", ApiKey } - }; - string responses = Util.HttpMethods.HttpPosts("http://localhost:8007/api/v1/contents/" + siteId + "/" + channelId, SendNew.ToJson(), ApiId); + { + { "X-SS-API-KEY", ApiKey } + }; + string responses = Util.HttpMethods.HttpPosts("http://192.168.50.127:8007/api/v1/contents/" + siteId + "/" + channelId, SendNew.ToJson(), ApiId); #endregion #region 修改审核状态 @@ -123,7 +123,7 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers AuditList AList = new AuditList(); if (Nid != null) { - AList.siteId = siteId; + AList.siteId = Convert.ToInt32(siteId); List listCon = new List(); //这里应该循环,如果多个 contents con = new contents(); @@ -131,8 +131,9 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers con.id = Convert.ToInt32(Nid); listCon.Add(con); AList.contents = listCon; - AList.reasons = "终审通过"; - Util.HttpMethods.HttpPosts("http://localhost:8007/api/v1/contents/actions/check", AList.ToJson(), ApiId); + //AList.reasons = "终审通过"; + //Util.HttpMethods.HttpPosts("http://192.168.50.127:8007/api/v1/contents/actions/check", AList.ToJson(), ApiId); + Util.HttpMethods.HttpPosts("http://192.168.50.127:8007/api/v1/contents/check", AList.ToJson(), ApiId); } #endregion return Success("发布成功!"); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config index 0907e0fdb..2bed3091c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config @@ -172,7 +172,7 @@ - - + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs index 4c8f43f31..d5264fa5a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs @@ -406,7 +406,7 @@ namespace Learun.Application.OA public class AuditList { - public string siteId { get; set; } + public int siteId { get; set; } public List contents { get; set; } public string reasons { get; set; } } From 2285f8a33c8c1f5cd8316b9413a0bacb77f381c1 Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 24 Dec 2021 21:45:48 +0800 Subject: [PATCH 2/2] --- .../LR_OAModule/Controllers/NewsController.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NewsController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NewsController.cs index 4726ab670..d90f6524d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NewsController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NewsController.cs @@ -1,6 +1,7 @@ using Learun.Application.OA; using Learun.Application.TwoDevelopment.LR_Desktop; using Learun.Util; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Configuration; @@ -117,9 +118,7 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers #endregion #region 修改审核状态 - JavaScriptSerializer Jss = new JavaScriptSerializer(); - Dictionary DicText = (Dictionary)Jss.DeserializeObject(responses); - string Nid = DicText["id"].ToString(); + string Nid = JsonConvert.DeserializeObject(responses).value.id; AuditList AList = new AuditList(); if (Nid != null) { @@ -132,7 +131,6 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers listCon.Add(con); AList.contents = listCon; //AList.reasons = "终审通过"; - //Util.HttpMethods.HttpPosts("http://192.168.50.127:8007/api/v1/contents/actions/check", AList.ToJson(), ApiId); Util.HttpMethods.HttpPosts("http://192.168.50.127:8007/api/v1/contents/check", AList.ToJson(), ApiId); } #endregion @@ -158,4 +156,13 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers #endregion } + public class Root + { + public RootValue value { get; set; } + } + + public class RootValue + { + public string id { get; set; } + } } \ No newline at end of file