From 7af1b2358ecdbba2ca6a611557186206db54d1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Fri, 2 Feb 2024 17:28:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=91=E6=9F=9A=E9=9D=99=E6=80=81=20?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E4=BF=AE=E6=94=B93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastphp/base/Controller.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fastphp/base/Controller.php b/fastphp/base/Controller.php index baacaeb..b9ba4e5 100644 --- a/fastphp/base/Controller.php +++ b/fastphp/base/Controller.php @@ -5,7 +5,7 @@ * @Author: kangkang * @Date: 2020-09-30 17:32:46 * @LastEditors: “wanyongkang” “937888580@qq.com” - * @LastEditTime: 2022-09-13 21:14:24 + * @LastEditTime: 2024-02-02 17:27:51 */ namespace fastphp\base; @@ -22,6 +22,11 @@ class Controller //初始化属性,实例化对应模型 public function __construct($controller,$action) { + if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { + header('HTTP/1.1 405 Method Not Allowed'); + header('Allow: GET, POST, PUT, DELETE'); + exit; + } $data = json_decode(file_get_contents("php://input"),true); $getPayload = false; if(isset($data['cookie'])){ @@ -44,11 +49,11 @@ class Controller $getPayload=$jwt->verifyToken($_SERVER['HTTP_TOKEN']); $ip = getIp(); - $ip_limit = trim(file_get_contents('/var/www/ip/ip')); + // $ip_limit = trim(file_get_contents('/var/www/ip/ip')); // if ((strpos($ip_limit, $ip) == false)&&$ip!=$ip_limit&&$getPayload['OperaterID']<100000) { - if ((strpos($ip_limit, $ip) == false)&&$getPayload['OperaterID']<100000) { - die; - } + // if ((strpos($ip_limit, $ip) == false)&&$getPayload['OperaterID']<100000) { + // die; + // } } else { die; }