appid:wx78808602da8913f8
url:https://api.muaaa.cn/apii/acswechat/opindex
public function opindexAction(){
header("Content-type: text/html; charset=utf-8");
//valid signature , option
if ($this->checkSignature()) {
echo $_GET["echostr"];
exit;
}
}
//验证所有者使用
private function checkSignature(){
header("Content-type: text/html; charset=utf-8");
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$token = 'muaaawechattoken';
$tmpArr = [$token, $timestamp, $nonce];
sort($tmpArr);
$tmpStr = implode('',$tmpArr);
$tmpStr = sha1( $tmpStr );
if( $tmpStr == $signature ){
return true;
}else{
return false;
}
}