From 6251b2ccdbd0236031d84b707fbf58f45993dab6 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 4 Dec 2015 08:48:44 +0800 Subject: [PATCH] =?UTF-8?q?route=E7=B1=BB=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/app.php | 5 ++++- library/think/route.php | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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路由