Comments (6)
我刚才通过CheckSignature.GetSignature(timestamp, nonce, Token)的值和微信发来的signature值是一样的,微信的是小写,而你的计算出来的是大写。
from weixinmpsdk.
这个是最基础的方法,一直在用,没有问题。
代码里面也没有添加大小写的转换,目前测试一切正常。你可以看一下是不是其他环节影响了。
from weixinmpsdk.
你可以运行一下源码中的单元测试查看结果:CheckSignatureTest.cs / public void GetSignatureTest()
从来没出现过大写的情况。
from weixinmpsdk.
[HttpGet]
[ActionName("Index")]
public ActionResult Get(string signature, string timestamp, string nonce, string echostr) {
if (CheckSignature.Check(signature, timestamp, nonce, Token)) {
return Content(echostr); //返回随机字符串则表示验证通过
}
else {
LogHelper.WriteLog(signature + "=" + CheckSignature.GetSignature(timestamp, nonce, Token));
return Content("失败:" + signature + "," + CheckSignature.GetSignature(timestamp, nonce, Token) + "。" + "如果你在浏览器中看到这句话,说明此地址可以被作为微信公众账号后台的Url,请注意保持Token一致。");
}
}
日志记录如下:
写入时间:14:52:52.2802734
日志描述:94716546c07499bf36ab6dc664468cf5a7b8d903=94716546C07499BF36AB6DC664468CF5A7B8D903
from weixinmpsdk.
难道是我引用的版本的问题?
我引用的版本是v5.1.0.26011
from weixinmpsdk.
和版本无关,这个方法一直都是好的,腾讯官方也没有修改过算法,检查一下微信后台的设置和你程序是否匹配吧。
from weixinmpsdk.
Related Issues (20)
- 退款订单查询提示入参错误,无法实现查询 HOT 5
- 退款回调通知数据无法获取,紧急 HOT 9
- 微信APIv3参数如何填写 HOT 1
- 企业微信接入抛出异常 RequestMessage转换出错!可能是MsgType和InfoType都不存在! HOT 5
- 缺少OCR识别功能 HOT 1
- 企业微信服务商代开发授权成功通知缺少State参数 HOT 2
- 微信推送消息,缺少一个取消授权的类型RequestMessageType HOT 2
- .NET 8 HOT 2
- 企业微信审批模板创建失败 HOT 2
- 微信小程序虚拟支付求支持!!! HOT 1
- 服务商模式 V3退款订单查询 提示缺少sub_mchid HOT 2
- 微信官方更新了URLLINK接口 HOT 1
- Sample/TenpayV3.sln无法正确编译 HOT 2
- 虚拟支付-query_user_balance-返回结果类型"first_save_flag"错误
- 【急】微信支付分取消订单,完成订单都报错,是不是out_trade_no里应该加上JsonIgnore特性? HOT 6
- .net core 7中 始终找不到 UseSenparcWeixin方法 HOT 2
- 企业微信上传文件的接口是错的,引起媒体文件为空 HOT 2
- 微信支付native方式支付回调响应参数没有封装payer.openid这个属性 HOT 1
- 请问,怎样关闭公众号事件推送的日志? HOT 2
- 小程序发货信息管理服务
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weixinmpsdk.