基础配置与底层修改
This commit is contained in:
@@ -136,9 +136,10 @@ class Fastphp
|
|||||||
//配置数据库信息
|
//配置数据库信息
|
||||||
public function setDbConfig()
|
public function setDbConfig()
|
||||||
{
|
{
|
||||||
|
global $is_script;
|
||||||
$formal_origin = $this->config['formal_origin']; //跨域访问的时候才会存在此字段
|
$formal_origin = $this->config['formal_origin']; //跨域访问的时候才会存在此字段
|
||||||
$origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_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_HOST', $this->config['db']['host']);
|
||||||
define('DB_PORT', $this->config['db']['port']);
|
define('DB_PORT', $this->config['db']['port']);
|
||||||
define('DB_NAME', $this->config['db']['dbname']);
|
define('DB_NAME', $this->config['db']['dbname']);
|
||||||
|
|||||||
Reference in New Issue
Block a user