Browse Source

改进本地调试判断

firzen 6 years ago
parent
commit
bade715396
1 changed files with 2 additions and 2 deletions
  1. 2 2
      server/Application/Api/Controller/BaseController.class.php

+ 2 - 2
server/Application/Api/Controller/BaseController.class.php

@@ -14,7 +14,7 @@ class BaseController extends Controller {
 		//做一个检测,以免这个配置更新到线上。
 		if (
 			$this->is_local_debug > 0 
-			&&$_SERVER['HTTP_HOST'] != '127.0.0.1' 
+			&& strpos($_SERVER['HTTP_HOST'],'127.0.0.1') === false  
 			&& $_SERVER['HTTP_HOST'] != 'wu.com' 
 			&& strpos($_SERVER['HTTP_HOST'], "192.168") == false
 		){
@@ -95,7 +95,7 @@ class BaseController extends Controller {
 		if ($this->is_local_debug > 0 ) {
 			header('Access-Control-Allow-Origin: *');//允许跨域请求
 			header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Connection, User-Agent, Cookie');
-			header('Access-Control-Allow-Credentials : true');//允许跨域请求
+			header('Access-Control-Allow-Credentials: true');//允许跨域请求
 		}
 		echo json_encode($result);