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;
echo 'weixin001';
exit;
}
}
public function show(){
echo 'weixin';
}
}
这个页面上什么都不出来
你试试 http://192.168.0.107/app/index.php/index/show,这样应该就出来了