地址:http://192.168.0.107/app/index.php
代码:<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
public function index(){
$nonce =$_GET['nonce'];
$token ='weixin';
$timestamp=$_GET['timestamp'];
$echostr=$_GET['echostr'];
$signature=$_GET['signature'];
$array =array();
$array =array($nonce,$timestamp,$token);
sort($array);
$str=sha1(implode($array));
if( $str==$signature && $echostr){
//第一次接入微信API接口的时候才会验证合法性
echo $echostr;
exit;
}
}
public function show(){
echo 'weixin';
}
}
Aslan丶