From cf665ce791e6df757be022c2838beeaa4cc0ec05 Mon Sep 17 00:00:00 2001 From: shinn lancelot <945226793@qq.com> Date: Mon, 10 Sep 2018 16:52:19 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E6=8E=A5=E5=8F=A3=E9=99=90=E5=88=B6=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 1ad81f1..423907a 100644 --- a/index.php +++ b/index.php @@ -6,14 +6,14 @@ // 限制来源 $referer = getReferer(); $domain = $referer != '' ? parse_url($referer)['host'] : ''; -$domain || exit('禁止访问!'); +$code = $_GET['code']; +$domain || $code || exit('禁止访问!'); $file = './common/domainName.json'; -if (file_exists($file)) { +if (file_exists($file) && $domain) { $domainNameArr = json_decode(file_get_contents($file), true); count($domainNameArr) > 0 && !in_array($domain, $domainNameArr) && exit('禁止访问!代理接口安全域名校验出错!'); } -$code = $_GET['code']; $proxyScope = $_REQUEST['proxy_scope']; $proxyScope = $proxyScope ? $proxyScope : 'code'; // 代理操作作用域,默认仅获取code 'code':仅获取code 'access_token':获取access_token及openid $state = $_REQUEST['state'];