Skip to content

Commit

Permalink
Merge branch 'master' of github.com:myvas/AspNetCore.Weixin
Browse files Browse the repository at this point in the history
  • Loading branch information
huangxiangyao committed Mar 24, 2019
2 parents 7a20931 + 540640a commit f03b1d7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ https://www.nuget.org/packages/AspNetCore.Weixin/
## Settings
https://mp.weixin.qq.com

- 获取AppSecret
- 启用开发模式,部署网站并启用https/ssl,网址类似: https://xxx.xxx/wx
- 在“网站Token”中填写一串较长的随机字符串作为WebsiteToken
开发/基本配置/公众号开发信息
- 获取**AppSecret**

开发/基本配置/服务器配置:***修改设置*** | ***启用***
- 在“服务器地址(**URL**)"中,填写地址: http://xxx.xxx/wx or https://xxx.xxx/wx
- 在“网站**Token**”中,填写一串较长的随机字符串作为WebsiteToken
- 在“消息加解密密钥**EncodingAESKey**”中,生成一个
- 在“消息加解方式”中,**建议**选择“***安全模式***

## ConfigureServices
```
Expand All @@ -21,6 +25,10 @@ services.AddWeixin(options =>
options.AppSecret = _configuration["Weixin:AppSecret"];
options.WebsiteToken = _configuration["Weixin:WebsiteToken"];
options.EncodingAESKey = _configuration["Weixin:EncodingAESKey"];
options.Path = "/wx"; //默认值
options.Debug = false; //默认值,不允许使用微信web开发者工具(wechatdevtools)访问。若修改为true则允许。
options.Events = new WeixinMessageEvents()
{
OnTextMessageReceived = ctx => weixinEventSink.OnTextMessageReceived(ctx.Sender, ctx.Args),
Expand Down

0 comments on commit f03b1d7

Please sign in to comment.