From 6f855854f395714925b482ec4c7b6a2716675397 Mon Sep 17 00:00:00 2001 From: wanyongkang <937888580@qq.com> Date: Tue, 17 Nov 2020 10:44:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E9=85=8D=E7=BD=AE=E4=B8=8E?= =?UTF-8?q?=E5=BA=95=E5=B1=82=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastphp/Fastphp.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastphp/Fastphp.php b/fastphp/Fastphp.php index e4d5114..48a1880 100644 --- a/fastphp/Fastphp.php +++ b/fastphp/Fastphp.php @@ -136,9 +136,10 @@ class Fastphp //配置数据库信息 public function setDbConfig() { + global $is_script; $formal_origin = $this->config['formal_origin']; //跨域访问的时候才会存在此字段 $origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : ''; - if (!in_array($origin, $formal_origin)) { + if (!in_array($origin, $formal_origin) && !$is_script) { define('DB_HOST', $this->config['db']['host']); define('DB_PORT', $this->config['db']['port']); define('DB_NAME', $this->config['db']['dbname']);