Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

全面启用 MessageHandler 中间件,以及配套异步方法 #1979

Merged
merged 82 commits into from
Oct 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
48a85f5
v6.6.102
JeffreySu Oct 2, 2019
e4aeca6
优化 MessageHandler 中间件
JeffreySu Oct 2, 2019
5119213
Merge pull request #1961 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 2, 2019
43c1cb7
优化 MessageHandler 中间件
JeffreySu Oct 2, 2019
63d5de1
优化 MessageHandler 中间件
JeffreySu Oct 2, 2019
ad2938a
modify
JeffreySu Oct 2, 2019
77c10a6
Merge pull request #1962 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 2, 2019
9813113
优化异步消息中间件测试
JeffreySu Oct 2, 2019
63569b1
Merge pull request #1963 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 2, 2019
2468a45
修改 IIS 同步请求设置
JeffreySu Oct 2, 2019
e5c5fa9
Merge pull request #1964 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 2, 2019
31c3e71
Sample 4.4.1
JeffreySu Oct 2, 2019
efa4463
Merge pull request #1965 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 2, 2019
d265d33
Sample v4.4.2
JeffreySu Oct 2, 2019
841a23e
Merge pull request #1966 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 2, 2019
57eb068
完善中渐渐
JeffreySu Oct 2, 2019
6dcf4e1
完善中间件,完善 MessageHandler 单元测试(加密消息状态下有bug)
JeffreySu Oct 2, 2019
2814baa
Merge pull request #1967 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 2, 2019
e41c821
modify
JeffreySu Oct 2, 2019
704544e
Merge pull request #1968 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 2, 2019
836dbc4
Sample v4.4.4
JeffreySu Oct 2, 2019
ce80bd1
Merge pull request #1969 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 2, 2019
bee3706
优化 DefaultAsyncMethod
JeffreySu Oct 2, 2019
e10ea8e
Sample v4.4.5 优化中间件对加密消息的处理
JeffreySu Oct 2, 2019
fdf7196
Merge pull request #1970 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 2, 2019
6a1d5bb
modify
JeffreySu Oct 2, 2019
babd51a
调试中间件
JeffreySu Oct 3, 2019
5338505
Merge pull request #1971 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 3, 2019
50ed95b
modify
JeffreySu Oct 3, 2019
ed695fd
调整逻辑
JeffreySu Oct 3, 2019
6676ceb
尝试调整NeuChar执行优先级逻辑
JeffreySu Oct 3, 2019
085c31a
Merge pull request #1972 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 3, 2019
043ed71
调试
JeffreySu Oct 3, 2019
872fe71
Merge pull request #1973 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 3, 2019
2aa2231
添加更多中间件单元测试,继续调试
JeffreySu Oct 3, 2019
b57ec25
Merge pull request #1974 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 3, 2019
a4cd29c
消息模拟测试增加加密模式
JeffreySu Oct 3, 2019
1b05c88
添加调试代码
JeffreySu Oct 3, 2019
ff14e28
Merge pull request #1975 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 3, 2019
a6ee16e
提供 SenparcWeixinSettingItem 快速创建构造函数
JeffreySu Oct 3, 2019
bdb7937
优化 MessageHandler 中间件
JeffreySu Oct 3, 2019
35bb01b
Register 注册过程自动添加更多 SenparcSettingItem 信息
JeffreySu Oct 3, 2019
1a7abf4
Merge pull request #1976 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 3, 2019
3113c09
测试通过。全面启用消息中间件(异步)。
JeffreySu Oct 3, 2019
20ff4d8
modify
JeffreySu Oct 3, 2019
2bcac0d
Merge pull request #1977 from JeffreySu/Developer-MessageHandlerMiddl…
JeffreySu Oct 3, 2019
0b079d9
Sample v4.4.6 优化加密消息模拟
JeffreySu Oct 3, 2019
772fc7f
Sample 4.4.7 优化消息模拟器
JeffreySu Oct 3, 2019
8034bd9
升级到NeuChar preview3
JeffreySu Oct 3, 2019
aa91c58
中间件基类移植到NeuChar,其他模块以此作为基类进行扩展
JeffreySu Oct 3, 2019
e9cf44c
优化 MessageHandler 中间件
JeffreySu Oct 3, 2019
1349c69
进一步抽象中间件,将扩展方法移植到NeuChar
JeffreySu Oct 3, 2019
cb129ed
更新 NeuChar,升级 中间件,测试成功,继续优化
JeffreySu Oct 4, 2019
228937a
完成 Messagehandler 中间件升级
JeffreySu Oct 4, 2019
2e955fe
优化 MessageHandler 中间件,完成 MP 中间件搭建,配置代码可简化到1行
JeffreySu Oct 4, 2019
4a30715
modify
JeffreySu Oct 4, 2019
f857268
升级 NeuChar;Sample v4.4.10
JeffreySu Oct 4, 2019
033093c
Sample v4.4.11,完善消息模拟器,使用新版本 MessageAgent
JeffreySu Oct 4, 2019
918a7d2
Sample v4.4.12,小程序 MessageHandler 使用中间件
JeffreySu Oct 4, 2019
b22d690
添加 SenparcWeixinSetting.MpSetting 等一系列属性,用于快速筛选(限定)不同模块的指定参数
JeffreySu Oct 4, 2019
447d0af
添加新的 Work(企业微信)的参数
JeffreySu Oct 4, 2019
a6b4466
添加企业微信 MessageHandler 中间件
JeffreySu Oct 4, 2019
ee31d3e
Sample v4.4.14 添加企业号 MessageHandler 中间件
JeffreySu Oct 4, 2019
875e9e1
完成企业号MessageHandler中间件
JeffreySu Oct 4, 2019
3c01d61
清理测试信息
JeffreySu Oct 4, 2019
e87e778
升级到新版本NeuChar,提供更好的验证提示
JeffreySu Oct 4, 2019
e2118e8
升级到 NeuChar 新版本,开始异步方法优先
JeffreySu Oct 4, 2019
ce881c1
MP 完成改造
JeffreySu Oct 4, 2019
9962da4
Work 完成改造,添加部分异步方法
JeffreySu Oct 4, 2019
fbe19cf
WxOpen 部分完成异步MessageHandler改造
JeffreySu Oct 4, 2019
289640c
Work 添加注释
JeffreySu Oct 4, 2019
1d0e7ae
完善异步方法改写
JeffreySu Oct 4, 2019
5a8fdfa
修改单元测试
JeffreySu Oct 4, 2019
3d8563d
添加消息加密方法单元测试,测试通过
JeffreySu Oct 4, 2019
330b06d
升级NeuChar新版,更新中间件消息验证页面的提示内容
JeffreySu Oct 4, 2019
9c58b0e
调试Work
JeffreySu Oct 5, 2019
3302d23
Work 加密模块并更新官方最新示例(没有实质变化)
JeffreySu Oct 5, 2019
a207020
Work:解决微信官方示例中的一个bug
JeffreySu Oct 5, 2019
c5ef838
优化 Work 消息加密相关代码
JeffreySu Oct 5, 2019
c0d6148
新版本.102 preview7;Sample v4.5.0,,公众号、小程序、企业微信全面支持中间件消息处理,并开始以异步方法优先,进行升级
JeffreySu Oct 5, 2019
47c683a
websocket preview7
JeffreySu Oct 5, 2019
f4d2b30
Merge remote-tracking branch 'origin/master' into Developer
JeffreySu Oct 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ packages/
/Samples/net45-mvc/Senparc.Weixin.MP.Sample/App_Data/NeuChar/*
/Samples/net45-mvc/Senparc.Weixin.MP.Sample/App_Data/SenparcTraceLog/*
/Samples/netcore3.0-mvc/Senparc.Weixin.Sample.NetCore3/App_Data/SenparcTraceLog
/Samples/netcore3.0-mvc/Senparc.Weixin.Sample.NetCore3/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*----------------------------------------------------------------
Copyright (C) 2019 Senparc

文件名:CustomMessageHandlerAsync.cs
文件功能描述:自定义MessageHandler(异步方法)


创建标识:Senparc - 20191003
----------------------------------------------------------------*/

//DPBMARK_FILE MP
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Senparc.NeuChar.Context;
using Senparc.Weixin.Exceptions;
using Senparc.CO2NET.Extensions;
using Senparc.Weixin.HttpUtility;
using Senparc.Weixin.MP.AdvancedAPIs;
using Senparc.Weixin.MP.Entities;
using Senparc.Weixin.MP.Helpers;
using Senparc.Weixin.MP.MessageHandlers;
using Senparc.Weixin.MP.Sample.CommonService.Download;
using Senparc.Weixin.MP.Sample.CommonService.Utilities;
using Senparc.NeuChar.Entities;
using System.Threading;

#if NET45
using System.Web;
#else
using Microsoft.AspNetCore.Http;
#endif

//TODO:提供异步上下文消息方法

namespace Senparc.Weixin.MP.Sample.CommonService.CustomMessageHandler
{
/// <summary>
/// 自定义MessageHandler
/// </summary>
public partial class CustomMessageHandler
{
public override async Task OnExecutingAsync(CancellationToken cancellationToken)
{
//测试MessageContext.StorageData

var currentMessageContext = await base.GetCurrentMessageContext();
if (currentMessageContext.StorageData == null || (currentMessageContext.StorageData is int))
{
currentMessageContext.StorageData = (int)0;
await GlobalMessageContext.UpdateMessageContextAsync(currentMessageContext);//储存到缓存
}
await base.OnExecutingAsync(cancellationToken);
}

public override async Task OnExecutedAsync(CancellationToken cancellationToken)
{
var currentMessageContext = await base.GetCurrentMessageContext();
currentMessageContext.StorageData = ((int)currentMessageContext.StorageData) + 1;
GlobalMessageContext.UpdateMessageContext(currentMessageContext);//储存到缓存
await base.OnExecutedAsync(cancellationToken);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,33 +116,13 @@ public CustomMessageHandler(Stream inputStream, PostModel postModel, int maxReco
};
}

public override void OnExecuting()
{
//测试MessageContext.StorageData

var currentMessageContext = base.GetCurrentMessageContext();
if (currentMessageContext.StorageData == null || (currentMessageContext.StorageData is int))
{
currentMessageContext.StorageData = (int)0;
GlobalMessageContext.UpdateMessageContext(currentMessageContext);//储存到缓存
}
base.OnExecuting();
}

public override void OnExecuted()
{
base.OnExecuted();
var currentMessageContext = base.GetCurrentMessageContext();
currentMessageContext.StorageData = ((int)currentMessageContext.StorageData) + 1;
GlobalMessageContext.UpdateMessageContext(currentMessageContext);//储存到缓存
}

/// <summary>
/// 处理文字请求
/// </summary>
/// <param name="requestMessage">请求消息</param>
/// <returns></returns>
public override IResponseMessageBase OnTextRequest(RequestMessageText requestMessage)
public override async Task<IResponseMessageBase> OnTextRequestAsync(RequestMessageText requestMessage)
{
//说明:实际项目中这里的逻辑可以交给Service处理具体信息,参考OnLocationRequest方法或/Service/LocationSercice.cs

Expand Down Expand Up @@ -194,8 +174,7 @@ public override IResponseMessageBase OnTextRequest(RequestMessageText requestMes

var defaultResponseMessage = base.CreateResponseMessage<ResponseMessageText>();

var requestHandler =
requestMessage.StartHandler()
var requestHandler = await requestMessage.StartHandler()
//关键字不区分大小写,按照顺序匹配成功后将不再运行下面的逻辑
.Keyword("约束", () =>
{
Expand Down Expand Up @@ -399,13 +378,28 @@ public override IResponseMessageBase OnTextRequest(RequestMessageText requestMes
return defaultResponseMessage;
})

//Default不一定要在最后一个
.Default(() =>

//“一次订阅消息”接口测试
.Keyword("订阅", () =>
{
defaultResponseMessage.Content = "点击打开:https://sdk.weixin.senparc.com/SubscribeMsg";
return defaultResponseMessage;
})
//正则表达式
.Regex(@"^\d+#\d+$", () =>
{
defaultResponseMessage.Content = string.Format("您输入了:{0},符合正则表达式:^\\d+#\\d+$", requestMessage.Content);
return defaultResponseMessage;
})

//当 Default 使用异步方法时,需要写在最后一个,且 requestMessage.StartHandler() 前需要使用 await 等待异步方法执行;
//当 Default 使用同步方法,不一定要在最后一个,并且不需要使用 await
.Default(async () =>
{
var result = new StringBuilder();
result.AppendFormat("您刚才发送了文字信息:{0}\r\n\r\n", requestMessage.Content);

var currentMessageContext = base.GetCurrentMessageContext();
var currentMessageContext = await base.GetCurrentMessageContext();
if (currentMessageContext.RequestMessages.Count > 1)
{
result.AppendFormat("您刚才还发送了如下消息({0}/{1}):\r\n", currentMessageContext.RequestMessages.Count,
Expand All @@ -432,18 +426,6 @@ public override IResponseMessageBase OnTextRequest(RequestMessageText requestMes

defaultResponseMessage.Content = result.ToString();

return defaultResponseMessage;
})
//“一次订阅消息”接口测试
.Keyword("订阅", () =>
{
defaultResponseMessage.Content = "点击打开:https://sdk.weixin.senparc.com/SubscribeMsg";
return defaultResponseMessage;
})
//正则表达式
.Regex(@"^\d+#\d+$", () =>
{
defaultResponseMessage.Content = string.Format("您输入了:{0},符合正则表达式:^\\d+#\\d+$", requestMessage.Content);
return defaultResponseMessage;
});

Expand All @@ -455,14 +437,14 @@ public override IResponseMessageBase OnTextRequest(RequestMessageText requestMes
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public override IResponseMessageBase OnLocationRequest(RequestMessageLocation requestMessage)
public override async Task<IResponseMessageBase> OnLocationRequestAsync(RequestMessageLocation requestMessage)
{
var locationService = new LocationService();
var responseMessage = locationService.GetResponseMessage(requestMessage as RequestMessageLocation);
return responseMessage;
}

public override IResponseMessageBase OnShortVideoRequest(RequestMessageShortVideo requestMessage)
public override async Task<IResponseMessageBase> OnShortVideoRequestAsync(RequestMessageShortVideo requestMessage)
{
var responseMessage = this.CreateResponseMessage<ResponseMessageText>();
responseMessage.Content = "您刚才发送的是小视频";
Expand All @@ -474,7 +456,7 @@ public override IResponseMessageBase OnShortVideoRequest(RequestMessageShortVide
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public override IResponseMessageBase OnImageRequest(RequestMessageImage requestMessage)
public override async Task<IResponseMessageBase> OnImageRequestAsync(RequestMessageImage requestMessage)
{
//一隔一返回News或Image格式
if (base.GlobalMessageContext.GetMessageContext(requestMessage).RequestMessages.Count() % 2 == 0)
Expand Down Expand Up @@ -511,7 +493,7 @@ public override IResponseMessageBase OnImageRequest(RequestMessageImage requestM
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public override IResponseMessageBase OnVoiceRequest(RequestMessageVoice requestMessage)
public override async Task<IResponseMessageBase> OnVoiceRequestAsync(RequestMessageVoice requestMessage)
{
var responseMessage = CreateResponseMessage<ResponseMessageMusic>();
//上传缩略图
Expand Down Expand Up @@ -543,7 +525,7 @@ public override IResponseMessageBase OnVoiceRequest(RequestMessageVoice requestM
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public override IResponseMessageBase OnVideoRequest(RequestMessageVideo requestMessage)
public override async Task<IResponseMessageBase> OnVideoRequestAsync(RequestMessageVideo requestMessage)
{
var responseMessage = CreateResponseMessage<ResponseMessageText>();
responseMessage.Content = "您发送了一条视频信息,ID:" + requestMessage.MediaId;
Expand Down Expand Up @@ -583,7 +565,7 @@ public override IResponseMessageBase OnVideoRequest(RequestMessageVideo requestM
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public override IResponseMessageBase OnLinkRequest(RequestMessageLink requestMessage)
public override async Task<IResponseMessageBase> OnLinkRequestAsync(RequestMessageLink requestMessage)
{
var responseMessage = ResponseMessageBase.CreateFromRequestMessage<ResponseMessageText>(requestMessage);
responseMessage.Content = string.Format(@"您发送了一条连接信息:
Expand All @@ -593,7 +575,7 @@ public override IResponseMessageBase OnLinkRequest(RequestMessageLink requestMes
return responseMessage;
}

public override IResponseMessageBase OnFileRequest(RequestMessageFile requestMessage)
public override async Task<IResponseMessageBase> OnFileRequestAsync(RequestMessageFile requestMessage)
{
var responseMessage = requestMessage.CreateResponseMessage<ResponseMessageText>();
responseMessage.Content = string.Format(@"您发送了一个文件:
Expand All @@ -609,10 +591,10 @@ public override IResponseMessageBase OnFileRequest(RequestMessageFile requestMes
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public override IResponseMessageBase OnEventRequest(IRequestMessageEventBase requestMessage)
public override async Task<IResponseMessageBase> OnEventRequestAsync(IRequestMessageEventBase requestMessage)
{
var eventResponseMessage = base.OnEventRequest(requestMessage);//对于Event下属分类的重写方法,见:CustomerMessageHandler_Events.cs
//TODO: 对Event信息进行统一操作
var eventResponseMessage = await base.OnEventRequestAsync(requestMessage);//对于Event下属分类的重写方法,见:CustomerMessageHandler_Events.cs
//TODO: 对Event信息进行统一操作
return eventResponseMessage;
}

Expand All @@ -631,7 +613,7 @@ public override IResponseMessageBase DefaultResponseMessage(IRequestMessageBase
}


public override IResponseMessageBase OnUnknownTypeRequest(RequestMessageUnknownType requestMessage)
public override async Task<IResponseMessageBase> OnUnknownTypeRequestAsync(RequestMessageUnknownType requestMessage)
{
/*
* 此方法用于应急处理SDK没有提供的消息类型,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace Senparc.Weixin.MP.Sample.CommonService.WorkMessageHandler
{
public class WorkCustomMessageContext : Senparc.Weixin.Work.MessageContexts.DefaultWorkMessageContext
public class WorkCustomMessageContext : Senparc.Weixin.Work.MessageContexts.DefaultWorkMessageContext, IMessageContext<IWorkRequestMessageBase, IWorkResponseMessageBase>
{
public WorkCustomMessageContext()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ namespace Senparc.Weixin.MP.Sample.CommonService.WorkMessageHandlers
{
public class WorkCustomMessageHandler : WorkMessageHandler<WorkCustomMessageContext>
{
/// <summary>
/// 为中间件提供生成当前类的委托
/// </summary>
public static Func<Stream, PostModel, int, WorkCustomMessageHandler> GenerateMessageHandler = (stream, postModel, maxRecordCount) => new WorkCustomMessageHandler(stream, postModel, maxRecordCount);


public WorkCustomMessageHandler(Stream inputStream, PostModel postModel, int maxRecordCount = 0)
: base(inputStream, postModel, maxRecordCount)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
using Senparc.NeuChar.MessageHandlers;
using Senparc.NeuChar.Entities;
using Senparc.CO2NET.Utilities;
using System;
using System.Threading;

#if NET45
using System.Web.Configuration;
Expand All @@ -39,6 +41,12 @@ public partial class CustomWxOpenMessageHandler : WxOpenMessageHandler<CustomWxO
private string appId = Config.SenparcWeixinSetting.WxOpenAppId;
private string appSecret = Config.SenparcWeixinSetting.WxOpenAppSecret;

/// <summary>
/// 为中间件提供生成当前类的委托
/// </summary>
public static Func<Stream, PostModel, int, CustomWxOpenMessageHandler> GenerateMessageHandler = (stream, postModel, maxRecordCount) => new CustomWxOpenMessageHandler(stream, postModel, maxRecordCount);


public CustomWxOpenMessageHandler(Stream inputStream, PostModel postModel, int maxRecordCount = 0)
: base(inputStream, postModel, maxRecordCount)
{
Expand All @@ -64,20 +72,22 @@ public CustomWxOpenMessageHandler(Stream inputStream, PostModel postModel, int m
}


public override void OnExecuting()
public override async Task OnExecutingAsync(CancellationToken cancellationToken)
{
//测试MessageContext.StorageData
if (CurrentMessageContext.StorageData == null || (CurrentMessageContext.StorageData is int))
var currentMessageContext = await base.GetCurrentMessageContext();
if (currentMessageContext.StorageData == null || (currentMessageContext.StorageData is int))
{
CurrentMessageContext.StorageData = 0;
currentMessageContext.StorageData = 0;
}
base.OnExecuting();
await base.OnExecutingAsync(cancellationToken);
}

public override void OnExecuted()
public override async Task OnExecutedAsync(CancellationToken cancellationToken)
{
base.OnExecuted();
CurrentMessageContext.StorageData = ((int)CurrentMessageContext.StorageData) + 1;
await base.OnExecutedAsync(cancellationToken);
var currentMessageContext = await base.GetCurrentMessageContext();
currentMessageContext.StorageData = ((int)currentMessageContext.StorageData) + 1;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<Version>1.0.0.0</Version>
<Version>2.0.0.0</Version>
<AssemblyName>Senparc.Weixin.MP.Sample.CommonService</AssemblyName>
<RootNamespace>Senparc.Weixin.MP.Sample.CommonService</RootNamespace>
<Description>此项目是 Sample.netcore 下启动项目</Description>
<Description>此项目是 Sample.NETCore3 下启动项目</Description>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
<PackageReference Include="Senparc.NeuChar" Version="1.0.102-preview2" />
<PackageReference Include="Senparc.NeuChar" Version="1.0.102-preview7.4.2" />
<PackageReference Include="System.Diagnostics.FileVersionInfo" Version="4.3.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ namespace Senparc.Weixin.MP.Sample.Controllers
/// </summary>
public class WorkController : Controller
{
public static readonly string Token = "fzBsmSaI8XE1OwBh";//与企业微信账号后台的Token设置保持一致,区分大小写。
public static readonly string EncodingAESKey = "9J8CQ7iF9mLtQDZrUM1loOVQ6oNDxVtBi1DBU2oaewl";//与微信企业账号后台的EncodingAESKey设置保持一致,区分大小写。
public static readonly string CorpId = "wx7618c0a6d9358622";//与微信企业账号后台的EncodingAESKey设置保持一致,区分大小写。
public static readonly string Token = Config.SenparcWeixinSetting.WorkSetting.WeixinCorpToken;//与企业微信账号后台的Token设置保持一致,区分大小写。
public static readonly string EncodingAESKey = Config.SenparcWeixinSetting.WorkSetting.WeixinCorpEncodingAESKey;//与微信企业账号后台的EncodingAESKey设置保持一致,区分大小写。
public static readonly string CorpId = Config.SenparcWeixinSetting.WorkSetting.WeixinCorpId;//与微信企业账号后台的CorpId设置保持一致,区分大小写。


public WorkController()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace Senparc.Weixin.MP.Sample.WebForms
{
public partial class Work : System.Web.UI.Page
{
public static readonly string Token = "fzBsmSaI8XE1OwBh";//与微信企业账号后台的Token设置保持一致,区分大小写。
public static readonly string EncodingAESKey = "9J8CQ7iF9mLtQDZrUM1loOVQ6oNDxVtBi1DBU2oaewl";//与微信企业账号后台的EncodingAESKey设置保持一致,区分大小写。
public static readonly string CorpId = "wx7618c0a6d9358622";//与微信企业账号后台的EncodingAESKey设置保持一致,区分大小写。
public static readonly string Token = Config.SenparcWeixinSetting.WorkSetting.WeixinCorpToken;//与企业微信账号后台的Token设置保持一致,区分大小写。
public static readonly string EncodingAESKey = Config.SenparcWeixinSetting.WorkSetting.WeixinCorpEncodingAESKey;//与微信企业账号后台的EncodingAESKey设置保持一致,区分大小写。
public static readonly string CorpId = Config.SenparcWeixinSetting.WorkSetting.WeixinCorpId;//与微信企业账号后台的CorpId设置保持一致,区分大小写。

protected void Page_Load(object sender, EventArgs e)
{
Expand Down
Loading