diff --git a/CoreCms.Net.Middlewares/MiddlewareHelpers.cs b/CoreCms.Net.Middlewares/MiddlewareHelpers.cs index 12daa3e..8ab9002 100644 --- a/CoreCms.Net.Middlewares/MiddlewareHelpers.cs +++ b/CoreCms.Net.Middlewares/MiddlewareHelpers.cs @@ -25,7 +25,7 @@ namespace CoreCms.Net.Middlewares /// /// /// - public static IApplicationBuilder UseReuestResponseLog(this IApplicationBuilder app) + public static IApplicationBuilder UseRequestResponseLog(this IApplicationBuilder app) { return app.UseMiddleware(); } diff --git a/CoreCms.Net.RedisMQ/Subscribe/SendWxTemplateMessageSubscribe.cs b/CoreCms.Net.RedisMQ/Subscribe/SendWxTemplateMessageSubscribe.cs index 862a5b2..3d90edd 100644 --- a/CoreCms.Net.RedisMQ/Subscribe/SendWxTemplateMessageSubscribe.cs +++ b/CoreCms.Net.RedisMQ/Subscribe/SendWxTemplateMessageSubscribe.cs @@ -96,55 +96,55 @@ namespace CoreCms.Net.RedisMQ.Subscribe } - var templateMessageData = new Dictionary(); + var templateMessageData = new Dictionary(); var pageUrl = string.Empty; if (request.code == GlobalEnumVars.PlatformMessageTypes.CreateOrder.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["shipName"].ToString() }; - templateMessageData[templateData.data04] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["shipMobile"].ToString() }; - templateMessageData[templateData.data05] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["shipAddress"].ToString() }; - pageUrl = "/pages/member/order/orderdetail?orderId=" + parameters["orderId"]; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["shipName"].ToString() }; + templateMessageData[templateData.data04] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["shipMobile"].ToString() }; + templateMessageData[templateData.data05] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["shipAddress"].ToString() }; + pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"]; } else if (request.code == GlobalEnumVars.PlatformMessageTypes.RemindOrderPay.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["createTime"].ToString() }; - templateMessageData[templateData.data04] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = "订单即将失效,请及时付款!" }; - pageUrl = "/pages/member/order/orderdetail?orderId=" + parameters["orderId"]; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["createTime"].ToString() }; + templateMessageData[templateData.data04] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = "订单即将失效,请及时付款!" }; + pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"]; } else if (request.code == GlobalEnumVars.PlatformMessageTypes.OrderPayed.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["paymentTime"].ToString() }; - pageUrl = "/pages/member/order/orderdetail?orderId=" + parameters["orderId"]; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["paymentTime"].ToString() }; + pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"]; } else if (request.code == GlobalEnumVars.PlatformMessageTypes.DeliveryNotice.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["logiName"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["logiNo"].ToString() }; - pageUrl = "/pages/member/order/orderdetail?orderId=" + parameters["orderId"]; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["logiName"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["logiNo"].ToString() }; + pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"]; } else if (request.code == GlobalEnumVars.PlatformMessageTypes.AfterSalesPass.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["aftersalesId"].ToString() }; - templateMessageData[templateData.data04] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["aftersalesStatus"].ToString() }; - pageUrl = "/pages/member/order/orderdetail?orderId=" + parameters["orderId"]; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["aftersalesId"].ToString() }; + templateMessageData[templateData.data04] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["aftersalesStatus"].ToString() }; + pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"]; } else if (request.code == GlobalEnumVars.PlatformMessageTypes.RefundSuccess.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["sourceId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["aftersalesId"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["money"].ToString() }; - templateMessageData[templateData.data04] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["paymentCode"].ToString() }; - templateMessageData[templateData.data05] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["createTime"].ToString() }; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["sourceId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["aftersalesId"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["money"].ToString() }; + templateMessageData[templateData.data04] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["paymentCode"].ToString() }; + templateMessageData[templateData.data05] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["createTime"].ToString() }; } var result = await Send(weChatUserInfo.openid, templateData.templateId, templateMessageData, pageUrl); @@ -223,20 +223,21 @@ namespace CoreCms.Net.RedisMQ.Subscribe /// 发送数据 /// 路径(如:pages/index/index) /// - private async Task Send(string openId, string templateId, Dictionary tmpData, string pageUrl) + private async Task Send(string openId, string templateId, Dictionary tmpData, string pageUrl) { var jm = new WebApiCallBack(); var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken(); var client = _weChatApiHttpClientFactory.CreateWxOpenClient(); - var request = new CgibinMessageSubscribeBusinessSendRequest(); - + var request = new CgibinMessageSubscribeSendRequest(); + request.AccessToken = accessToken; - request.Page = pageUrl; + request.MiniProgramPagePath = pageUrl; request.TemplateId = templateId; request.ToUserOpenId = openId; request.Data = tmpData; + request.MiniProgramState = "formal"; - var response = await client.ExecuteCgibinMessageSubscribeBusinessSendAsync(request); + var response = await client.ExecuteCgibinMessageSubscribeSendAsync(request); if (response.IsSuccessful()) { jm.status = true; diff --git a/CoreCms.Net.Web.Admin/Startup.cs b/CoreCms.Net.Web.Admin/Startup.cs index 0586e39..e6568f9 100644 --- a/CoreCms.Net.Web.Admin/Startup.cs +++ b/CoreCms.Net.Web.Admin/Startup.cs @@ -162,7 +162,7 @@ namespace CoreCms.Net.Web.Admin public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { // ¼뷵 (ע⿪ȨޣȻ޷д) - app.UseReuestResponseLog(); + app.UseRequestResponseLog(); // ûʼ¼(ŵ㣬Ȼ쳣ᱨΪܷ)(ע⿪ȨޣȻ޷д) app.UseRecordAccessLogsMildd(); // ¼ip (ע⿪ȨޣȻ޷д) diff --git a/CoreCms.Net.Web.WebApi/Controllers/GoodController.cs b/CoreCms.Net.Web.WebApi/Controllers/GoodController.cs index 55816c8..9c3f345 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/GoodController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/GoodController.cs @@ -196,7 +196,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers className = category.name; } - var childs = await _goodsCategoryServices.QueryListByClauseAsync(p => p.parentId == category.id); + var childs = await _goodsCategoryServices.QueryListByClauseAsync(p => p.parentId == catId); if (childs.Any()) { var ids = childs.Select(p => p.id).ToList(); diff --git a/CoreCms.Net.Web.WebApi/Startup.cs b/CoreCms.Net.Web.WebApi/Startup.cs index 56b1688..c83893a 100644 --- a/CoreCms.Net.Web.WebApi/Startup.cs +++ b/CoreCms.Net.Web.WebApi/Startup.cs @@ -179,7 +179,7 @@ namespace CoreCms.Net.Web.WebApi public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { // ¼뷵 (ע⿪ȨޣȻ޷д) - app.UseReuestResponseLog(); + app.UseRequestResponseLog(); // ûʼ¼(ŵ㣬Ȼ쳣ᱨΪܷ)(ע⿪ȨޣȻ޷д) app.UseRecordAccessLogsMildd(); // ¼ip (ע⿪ȨޣȻ޷д)