Browse Source

添加公众号模板信息配置

develop
liujiaqiang 2 years ago
parent
commit
ddb443e0f5
  1. 7
      24Hour/WechatMessagerClient.cs
  2. 30
      24Hour/appsettings.json

7
24Hour/WechatMessagerClient.cs

@ -36,6 +36,10 @@ namespace _24Hour
/// </summary> /// </summary>
private string Gzhsecret = "wx48108a0c98a3dab0"; private string Gzhsecret = "wx48108a0c98a3dab0";
/// <summary> /// <summary>
/// 微信公众号模板Id
/// </summary>
private string GzhtemplateId = "wx48108a0c98a3dab0";
/// <summary>
/// 小程序secretID /// 小程序secretID
/// </summary> /// </summary>
private string secid = "e752e4fba67526eca21313a18c96a58f"; private string secid = "e752e4fba67526eca21313a18c96a58f";
@ -56,6 +60,7 @@ namespace _24Hour
secid = $"{configuration.GetSection("Wechat:secid").Value}"; secid = $"{configuration.GetSection("Wechat:secid").Value}";
Gzhappid = $"{configuration.GetSection("WechatGzh:appid").Value}"; Gzhappid = $"{configuration.GetSection("WechatGzh:appid").Value}";
Gzhsecret = $"{configuration.GetSection("WechatGzh:secret").Value}"; Gzhsecret = $"{configuration.GetSection("WechatGzh:secret").Value}";
GzhtemplateId = $"{configuration.GetSection("WechatGzh:templateId").Value}";
TemplateIdSuccess = $"{configuration.GetSection("Wechat:templateIdSuccess").Value}"; TemplateIdSuccess = $"{configuration.GetSection("Wechat:templateIdSuccess").Value}";
TemplateIdFail = $"{configuration.GetSection("Wechat:templateIdFail").Value}"; TemplateIdFail = $"{configuration.GetSection("Wechat:templateIdFail").Value}";
} }
@ -306,7 +311,7 @@ namespace _24Hour
msg = new msg = new
{ {
touser = useropenId, touser = useropenId,
template_id = "SmCAFFqHSnGC4FnRBFgkmuBvTBWkPnWi4zkjshrpz_8", template_id = GzhtemplateId,
//miniprogram =new{ //miniprogram =new{
// appid= appid, // appid= appid,
// pagepath= "pages/selfService/reception/reception" // pagepath= "pages/selfService/reception/reception"

30
24Hour/appsettings.json

@ -46,16 +46,34 @@
"rtsp": "rtsp://192.168.0.24:8554/live/" "rtsp": "rtsp://192.168.0.24:8554/live/"
}, },
"Wechat": { "Wechat": {
"appid": "wx48108a0c98a3dab0", //"appid": "wx48108a0c98a3dab0",
"secret": "e752e4fba67526eca21313a18c96a58f", //"secret": "e752e4fba67526eca21313a18c96a58f",
"secid": "e752e4fba67526eca21313a18c96a58f", //"secid": "e752e4fba67526eca21313a18c96a58f",
//"miniprogram_state": "trial",
//"templateIdSuccess": "XgrMTq1gwDfMJI6vN0jsSEv3xGy7v3amh0JMWj4SnAY",
//"templateIdFail": "bfA-t5EN4pkQzAOS17SRPRKvmMteaJt0kw3YKIcovIQ"
//
"appid": "wxdf1bb4a9a6331665",
"secret": "4a19512fbbc4c4658fdffcdbfa1fc8f4",
"secid": "4a19512fbbc4c4658fdffcdbfa1fc8f4",
"miniprogram_state": "trial", "miniprogram_state": "trial",
"templateIdSuccess": "XgrMTq1gwDfMJI6vN0jsSEv3xGy7v3amh0JMWj4SnAY", "templateIdSuccess": "XgrMTq1gwDfMJI6vN0jsSEv3xGy7v3amh0JMWj4SnAY",
"templateIdFail": "bfA-t5EN4pkQzAOS17SRPRKvmMteaJt0kw3YKIcovIQ" "templateIdFail": "bfA-t5EN4pkQzAOS17SRPRKvmMteaJt0kw3YKIcovIQ"
}, },
"WechatGzh": { // "WechatGzh": {
"appid": "wx1f5c662edbe3b627", //
"secret": "a892658a8d21f4e97cbb1ec1880b78fd", //"appid": "wx1f5c662edbe3b627",
//"secret": "a892658a8d21f4e97cbb1ec1880b78fd",
//"templateId": "SmCAFFqHSnGC4FnRBFgkmuBvTBWkPnWi4zkjshrpz_8",
//
"appid": "wx3a65effe2f8808c3",
"secret": "e645ec6643cd844ac1129b2eb7680477",
"templateId": "cwSTQjLRh-xhnpz41jGlPxMty_EOJBlyjuBNGEP6FyU"
//
//"appid": "wxe06040af55282ee8",
//"secret": "8ffcdb30277eba9f4861f39a66990237",
//"templateId": "2OIGzOuT1Xobi7xQV9AVH-A286HZ0FsayW6ON2n5_30"
}, },
"CaseTwenty": { "CaseTwenty": {
"SysAddress": "http://127.0.0.1:5194", "SysAddress": "http://127.0.0.1:5194",

Loading…
Cancel
Save