1.easywechat安装
2.weichat打通服务器function getTest(Request $request){
$token = 'zhenhaokeji';
$data = $request->all();
$signature = $data['signature'];
$timestamp = $data['timestamp'];
$nonce = $data['nonce'];
$echostr = $data['echostr'];
$arrtep = array($token, $timestamp, $nonce);
sort($arrtep, SORT_STRING);
$arrStr = implode($arrtep);
$hashcode = sha1($arrStr);
if($hashcode == $signature){
return $echostr;
}else{
return false;
}
}
作者:
Tyler Ning出处:http://www.cnblogs.com/tylerdonet/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,如有问题,请微信联系冬天里的一把火