<?php// 本类由系统自动生成,仅供测试用途class IndexAction extends Action { public function index(){$timestamp=$_GET['timestamp'];$nonce=$_GET['nonce'];$token="weixin";$signature=$_GET['signature'];$array=array($timestamp,$nonce,$token);sort($array);//2.将排序后的三个参数拼接之后用sha1加密$temstr=implode('',$array);$temstr=sha1($temstr);//3.将加密后的字符串与signature进行对比,判断该请求是否来自微信if($temstr==$signature){ echo $_GET['echostr']; exit;}} }?>
添加回答
举报
0/150
提交
取消