diff --git a/library/think/app.php b/library/think/app.php index 206210c0..e7772dcc 100644 --- a/library/think/app.php +++ b/library/think/app.php @@ -228,7 +228,10 @@ class App // 检测域名部署 if (!IS_CLI && !empty($config['domain_deploy'])) { - Route::checkDomain($config['domain_rules']); + $module = Route::checkDomain($config['domain_rules']); + if (null != $module) { + define('BIND_MODULE', $module); + } } // 监听path_info diff --git a/library/think/route.php b/library/think/route.php index 9c01703c..2ec71c44 100644 --- a/library/think/route.php +++ b/library/think/route.php @@ -194,7 +194,7 @@ class Route exit; } if (is_array($rule)) { - define('BIND_MODULE', $rule[0]); + $module = $rule[0]; if (isset($rule[1])) { // 传入参数 parse_str($rule[1], $parms); @@ -208,10 +208,11 @@ class Route $_GET = array_merge($_GET, $parms); } } else { - define('BIND_MODULE', $rule); + $module = $rule; } } } + return isset($module) ? $module : null; } // 检测URL路由