1 Star 1 Fork 2

奎宇工作室 / RsCode.WeChat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT
home editLink lang title description
false
false
zh-CN
微信平台SDK
微信平台SDK简介

前言

RsCode.WeChat 是河南软商网络科技有限公司开发的微信平台SDK,使用.net技术封装微信业务API,实现快速开发微信平台相关业务

源码托管

支持环境

  • .NET Core 3.1以上

当前版本

  • 正式发布: RsCode.WeChat

使用步骤

只需三步,完成使用RsCode.WeChat调用微信业务

  1. appsettings.json中配置申请的微信参数
"Tencent": {
    "WeChat": [
      {
        "Id": "gh_e1cxxx",
        "AppId": "wxxxxxx",
        "AppSecret": "xxx",
        "Token": "xxx",
        "EncodingAESKey": "xxx",
        "DataFormatter": "xml" //与微信通信消息格式
      }
    ]
  }
  1. 使用NuGet 引用RsCode.WeChat

添加代码

//添加微信服务 
services.AddWeChat();

//添加微信服务中间件
app.UseWeChat();
  1. 打开微信平台,配置与微信通信相关的url为 指定的地址

http://{your domain}/wxcallback

例如:

登录微信公众号后台--设置与开发--基本配置--服务器配置,设置,服务器地址(URL) 为 https://xxx/wxcallback

登录微信小程序--开发--开发管理--消息推送,

第三方平台-开发配置--开发资料 设置 授权事件接收配置 https://xx.cn/wxcallback/component , 消息与事件接收配置https://xx.cn/wxcallback/biz/$APPID$

调用微信SDK实例

public class HomeController:ControllerBase
{
    IWeChatClient wechat;
    public HomeController(IWeChatClient _wechat)
    {
        wechat=_wechat;
    }
    
    public async Task<string> Test()
    {
        string appId="wx1323123412";
        string token="abc";
        var res=await wechat.SendAsync<JsapiTicketResponse>(new JsapiTicketRequest(accessToken));
    }
}
MIT License Copyright (c) 2020 软商网络 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

RsCode.WeChat 是河南软商网络科技有限公司开发微信SDK,使用.net技术封装微信提供的业务API,实现快速开发微信平台相关业务 展开 收起
C#
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/kuiyu/RsCode.WeChat.git
git@gitee.com:kuiyu/RsCode.WeChat.git
kuiyu
RsCode.WeChat
RsCode.WeChat
master

搜索帮助