KenChung

很久没碰公众号开发了 今天帮别人开发公众号 重新记录一下

/**
 * 验证方法
 * @return bool
 */
function checkSignature(){
    $signature = $_GET["signature"];
    $tmpArr = [
        \'timestamp\' => $_GET["timestamp"],
        \'nonce\' => $_GET["nonce"],
        \'token\' => \'xxx\',
    ];
    sort($tmpArr);
    $tmpStr = implode( $tmpArr );
    $tmpStr = sha1( $tmpStr );

    if( $signature == $tmpStr ){
        return  $_GET[\'echostr\'];
    }else{
        return false;
    }
}

$res = checkSignature();
if($res){
    echo $res;
}

 

写到一个可以访问的php文件里 然后将这个php 文件的访问地址 填到 验证url 里面 填写其它资料 提交就可以了

 

分类:

技术点:

相关文章:

  • 2021-04-05
  • 2021-07-02
  • 2021-11-08
  • 2021-10-17
  • 2021-12-22
  • 2021-11-04
  • 2021-10-19
  • 2021-09-27
猜你喜欢
  • 2021-11-17
  • 2021-11-07
  • 2021-04-03
  • 2021-12-12
  • 2021-10-17
  • 2021-12-22
相关资源
相似解决方案