<?php
$nonce = $_GET['nonce'];
$token = 'weixin';
$timestamp = $_GET['timestamp'];
$echostr = $_GET['echostr'];
$signature = $_GET['signature'];
//形成数组,然后按字典序排序
$array = array();
$array = array($nonce, $timestamp, $token);
sort($array);
//拼接成字符串,sha1加密 ,然后与signature进行校验
$str = sha1( implode( $array ) );
if( $str == $signature && $echostr ){
//第一次接入weixin api接口的时候
echo $echostr;
exit;
}
die('123');
菜单设置:
{
"button": [{
"type":"click",
"name": "政策解读",
"sub_button": [{
"type": "view",
"url": "http://qhwanqi.com/",
"name": "前海政策"
}, {
"type": "view",
"url": "http://qhwanqi.com/",
"name": "人才补贴"
}]
}, {
"name": "服务列表",
"type": "view",
"url": "http://qhwanqi.com/#/service/list"
}, {
"name": "用户中心",
"type":"click",
"sub_button": [{
"type": "view",
"url": "http://qhwanqi.com/#/my",
"name": "我的服务"
}]
}]
}
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有