thinkphp5过滤下就好了
if ($this->request->isGet()){
//回调地址会传回一个code,则我们根据code去获取openid和授权获取到的access_token
$code = $_GET['code'];
}
通过测试发现微信开发者工具是模拟的手机options请求
thinkphp5打印方法
// 是否为手机访问
if (Request::instance()->isMobile()) echo "当前为手机访问";
// 是否为 OPTIONS 请求
if (Request::instance()->isOptions()) echo "当前为 OPTIONS 请求";