收藏
回答

检验signature的PHP示例代码有问题,应该这样写

https://developers.weixin.qq.com/miniprogram/dev/framework/server-ability/message-push.htmlhttps://developers.weixin.qq.com/doc/offiaccount/Message_Management/Template_Message_Interface.html

private function checkSignature()
{
    $signature = $_GET["signature"];
    $timestamp = $_GET["timestamp"];
    $nonce = $_GET["nonce"];
    $echostr = $_GET["echostr"];

    $token = TOKEN;
    $tmpArr = array($token, $timestamp, $nonce);
    sort($tmpArr, SORT_STRING);
    $tmpStr = implode( $tmpArr );
    $tmpStr = sha1( $tmpStr );

    if ($tmpStr == $signature ) {
        return $echostr;
    } else {
        return false;
    }
}


回答关注问题邀请回答
收藏

1 个回答

  • Demons
    Demons
    02-24

    这边排查一下

    02-24
    有用
    回复
登录 后发表内容