GithubHelp home page GithubHelp logo

Comments (6)

koeltp avatar koeltp commented on May 19, 2024

我刚才通过CheckSignature.GetSignature(timestamp, nonce, Token)的值和微信发来的signature值是一样的,微信的是小写,而你的计算出来的是大写。

from weixinmpsdk.

JeffreySu avatar JeffreySu commented on May 19, 2024

这个是最基础的方法,一直在用,没有问题。
代码里面也没有添加大小写的转换,目前测试一切正常。你可以看一下是不是其他环节影响了。

from weixinmpsdk.

JeffreySu avatar JeffreySu commented on May 19, 2024

你可以运行一下源码中的单元测试查看结果:CheckSignatureTest.cs / public void GetSignatureTest()

https://github.com/JeffreySu/WeiXinMPSDK/blob/master/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/CheckSignatureTest.cs

从来没出现过大写的情况。

from weixinmpsdk.

koeltp avatar koeltp commented on May 19, 2024
    [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.

koeltp avatar koeltp commented on May 19, 2024

难道是我引用的版本的问题?
我引用的版本是v5.1.0.26011

from weixinmpsdk.

JeffreySu avatar JeffreySu commented on May 19, 2024

和版本无关,这个方法一直都是好的,腾讯官方也没有修改过算法,检查一下微信后台的设置和你程序是否匹配吧。

from weixinmpsdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.