!164 【修复】小程序模板消息推送误用公众号推送,导致发送失败的问题。【修复】修复一个命名错误的问题。【修复】获取商品列表存在商品目录可能不存在的问题。

* 【修复】小程序模板消息推送误用公众号推送,导致发送失败的问题。
* 【修复】获取商品列表存在商品目录可能不存在的问题。
* 【修复】拼团链接问题,导致拼团objectId获取不到变undefined了。#I4I0LM
* 【修复】修复一些细节样式问题。
pull/165/MERGE
大灰灰 3 years ago
parent 28efa12b8a
commit 22be34c1d8

@ -25,7 +25,7 @@ namespace CoreCms.Net.Middlewares
/// </summary>
/// <param name="app"></param>
/// <returns></returns>
public static IApplicationBuilder UseReuestResponseLog(this IApplicationBuilder app)
public static IApplicationBuilder UseRequestResponseLog(this IApplicationBuilder app)
{
return app.UseMiddleware<RequRespLogMildd>();
}

@ -96,55 +96,55 @@ namespace CoreCms.Net.RedisMQ.Subscribe
}
var templateMessageData = new Dictionary<string, CgibinMessageSubscribeBusinessSendRequest.Types.DataItem>();
var templateMessageData = new Dictionary<string, CgibinMessageSubscribeSendRequest.Types.DataItem>();
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
/// <param name="tmpData">发送数据</param>
/// <param name="pageUrl">路径pages/index/index</param>
/// <returns></returns>
private async Task<WebApiCallBack> Send(string openId, string templateId, Dictionary<string, CgibinMessageSubscribeBusinessSendRequest.Types.DataItem> tmpData, string pageUrl)
private async Task<WebApiCallBack> Send(string openId, string templateId, Dictionary<string, CgibinMessageSubscribeSendRequest.Types.DataItem> 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;

@ -162,7 +162,7 @@ namespace CoreCms.Net.Web.Admin
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// 记录请求与返回数据 (注意开启权限,不然本地无法写入)
app.UseReuestResponseLog();
app.UseRequestResponseLog();
// 用户访问记录(必须放到外层,不然如果遇到异常,会报错,因为不能返回流)(注意开启权限,不然本地无法写入)
app.UseRecordAccessLogsMildd();
// 记录ip请求 (注意开启权限,不然本地无法写入)

@ -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();

@ -179,7 +179,7 @@ namespace CoreCms.Net.Web.WebApi
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// 记录请求与返回数据 (注意开启权限,不然本地无法写入)
app.UseReuestResponseLog();
app.UseRequestResponseLog();
// 用户访问记录(必须放到外层,不然如果遇到异常,会报错,因为不能返回流)(注意开启权限,不然本地无法写入)
app.UseRecordAccessLogsMildd();
// 记录ip请求 (注意开启权限,不然本地无法写入)

Loading…
Cancel
Save