From a201617a922351ca628dda0740b6e8edeea930a2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-M4V1LH5\\Jin" Date: Sat, 11 Apr 2020 18:17:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BB=84=E4=BB=B6=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- COMCMS.API/COMCMS.API.csproj | 6 +++--- .../CustomMessageHandler.cs | 2 +- COMCMS.Common/COMCMS.Common.csproj | 2 +- COMCMS.Common/ThumbnailHelper.cs | 4 ++-- COMCMS.Common/Utils.cs | 10 ++++++++++ COMCMS.Core/COMCMS.Core.csproj | 2 +- COMCMS.Web/COMCMS.Web.csproj | 20 +++++++++---------- COMCMS.Web/Controllers/WeixinController.cs | 1 + .../Controllers/api/PaymentController.cs | 6 +++--- COMCMS.Web/Startup.cs | 2 +- .../Views/Article/Detail_Contact.cshtml | 2 +- .../NewLife.UserGroup.WebUploader.csproj | 2 +- XCoder/Entity/Build.tt | 2 +- XCoder/Entity/Build_netcore.tt | 18 +++++++++++++++++ XCoder/Entity/Model.xml | 11 +++++----- XCoder/XCoder(代码生成器).csproj | 17 ++++++++++++---- XCoder/packages.config | 4 ++-- 17 files changed, 74 insertions(+), 37 deletions(-) create mode 100644 XCoder/Entity/Build_netcore.tt diff --git a/COMCMS.API/COMCMS.API.csproj b/COMCMS.API/COMCMS.API.csproj index a675440..57f6c52 100644 --- a/COMCMS.API/COMCMS.API.csproj +++ b/COMCMS.API/COMCMS.API.csproj @@ -5,9 +5,9 @@ - - - + + + diff --git a/COMCMS.API/Weixin/CustomMessageHandler/CustomMessageHandler.cs b/COMCMS.API/Weixin/CustomMessageHandler/CustomMessageHandler.cs index 6d45d8a..c2e1117 100644 --- a/COMCMS.API/Weixin/CustomMessageHandler/CustomMessageHandler.cs +++ b/COMCMS.API/Weixin/CustomMessageHandler/CustomMessageHandler.cs @@ -45,7 +45,7 @@ namespace COMCMS.API.Weixin.CustomMessageHandler //比如MessageHandler.GlobalGlobalMessageContext.ExpireMinutes = 3。 GlobalMessageContext.ExpireMinutes = 3; - OnlyAllowEcryptMessage = true;//是否只允许接收加密消息,默认为 false + //OnlyAllowEcryptMessage = true;//是否只允许接收加密消息,默认为 false if (!string.IsNullOrEmpty(postModel.AppId)) { diff --git a/COMCMS.Common/COMCMS.Common.csproj b/COMCMS.Common/COMCMS.Common.csproj index 148e029..1767c84 100644 --- a/COMCMS.Common/COMCMS.Common.csproj +++ b/COMCMS.Common/COMCMS.Common.csproj @@ -6,7 +6,7 @@ - + diff --git a/COMCMS.Common/ThumbnailHelper.cs b/COMCMS.Common/ThumbnailHelper.cs index 386dd00..b8ebbda 100644 --- a/COMCMS.Common/ThumbnailHelper.cs +++ b/COMCMS.Common/ThumbnailHelper.cs @@ -22,11 +22,11 @@ namespace COMCMS.Common /// /// 程序绝对目录 /// - private static string _ContentRootPath = DI.ServiceProvider.GetService().ContentRootPath; + private static string _ContentRootPath = Environment.CurrentDirectory; /// /// 静态文件 /// - private static string _WebRootPath = DI.ServiceProvider.GetService().WebRootPath; + private static string _WebRootPath = _ContentRootPath + DirectorySeparatorChar + "wwwroot" + DirectorySeparatorChar; #region 方式 public enum CutMode diff --git a/COMCMS.Common/Utils.cs b/COMCMS.Common/Utils.cs index e62564f..5805f76 100644 --- a/COMCMS.Common/Utils.cs +++ b/COMCMS.Common/Utils.cs @@ -346,6 +346,16 @@ namespace COMCMS.Common return false; } } + + /// + /// 是否为日期型字符串 + /// + /// 日期字符串(2008-05-08) + /// + public static bool IsDate(string StrSource) + { + return Regex.IsMatch(StrSource, @"^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-9]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$"); + } #endregion #region 获取部分 diff --git a/COMCMS.Core/COMCMS.Core.csproj b/COMCMS.Core/COMCMS.Core.csproj index 52d92fd..fcbd11a 100644 --- a/COMCMS.Core/COMCMS.Core.csproj +++ b/COMCMS.Core/COMCMS.Core.csproj @@ -5,7 +5,7 @@ - + diff --git a/COMCMS.Web/COMCMS.Web.csproj b/COMCMS.Web/COMCMS.Web.csproj index 4787130..df22c9c 100644 --- a/COMCMS.Web/COMCMS.Web.csproj +++ b/COMCMS.Web/COMCMS.Web.csproj @@ -5,19 +5,19 @@ - - - - + + + + - + - - - + + + - - + + diff --git a/COMCMS.Web/Controllers/WeixinController.cs b/COMCMS.Web/Controllers/WeixinController.cs index a57ac04..dab2d7a 100644 --- a/COMCMS.Web/Controllers/WeixinController.cs +++ b/COMCMS.Web/Controllers/WeixinController.cs @@ -14,6 +14,7 @@ using COMCMS.API.Weixin.CustomMessageHandler; using Senparc.Weixin; using Senparc.NeuChar.MessageHandlers; using Senparc.Weixin.MP.MvcExtension; +using Senparc.CO2NET.AspNet.HttpUtility; namespace COMCMS.Web.Controllers { diff --git a/COMCMS.Web/Controllers/api/PaymentController.cs b/COMCMS.Web/Controllers/api/PaymentController.cs index eaa9e43..caf30d8 100644 --- a/COMCMS.Web/Controllers/api/PaymentController.cs +++ b/COMCMS.Web/Controllers/api/PaymentController.cs @@ -17,12 +17,12 @@ namespace COMCMS.Web.Controllers.api /// /// 支付API /// - public class PaymentController : Controller + public class PaymentController : APIBaseController { #region 微信小程序订单支付 [HttpGet] [CheckFilter] - public ReJson DoPayOrder(string ordernum) + public ReJson DoWXAppPayOrder(string ordernum) { //获取订单 Order entity = Order.Find(Order._.OrderNum == ordernum); @@ -137,7 +137,7 @@ namespace COMCMS.Web.Controllers.api //reJson.message = "下单成功!"; //reJson.detail = detail; //return reJson; - return new ReJson(40000, "下单成功!", detail); + return new ReJson(0, "下单成功!", detail); } catch (Exception ex) { diff --git a/COMCMS.Web/Startup.cs b/COMCMS.Web/Startup.cs index 4fb132c..d3116f0 100644 --- a/COMCMS.Web/Startup.cs +++ b/COMCMS.Web/Startup.cs @@ -170,7 +170,7 @@ namespace COMCMS.Web }); app.UseMiddlewareExtension(new ResultExceptionHandler()); - IRegisterService register = RegisterService.Start(env, senparcSetting.Value).UseSenparcGlobal(); + IRegisterService register = RegisterService.Start(senparcSetting.Value).UseSenparcGlobal(); register.UseSenparcWeixin(senparcWeixinSetting.Value, senparcSetting.Value);//微信全局注册,必须! //加入HttpContext //MyHttpContext.ServiceProvider = svp; diff --git a/COMCMS.Web/Views/Article/Detail_Contact.cshtml b/COMCMS.Web/Views/Article/Detail_Contact.cshtml index 9cbd3eb..10eba34 100644 --- a/COMCMS.Web/Views/Article/Detail_Contact.cshtml +++ b/COMCMS.Web/Views/Article/Detail_Contact.cshtml @@ -8,7 +8,7 @@ //获取同级分类 IList sameList = ArticleCategory.FindAll(ArticleCategory._.PId == ViewBag.kind.PId, ArticleCategory._.Rank.Asc(), null, 0, 0); } - +