1 回复
要把微信返回的再返回给微信就可以验证通过了
$signature = $_GET[“signature”];
$timestamp = $_GET[“timestamp”];
$nonce = $_GET[“nonce”];
$token = ‘efae1312e21e1xc’;
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr, SORT_STRING);
$tmpStr = implode( $tmpArr );
$tmpStr = sha1( $tmpStr );
$this->log($tmpStr);
$this->log($signature);
if( $tmpStr == $signature ){
echo $_GET[‘echostr’];
exit;
}else{
return false;
}