From 164526ea33b06b62377a00fa33d52120fb2acc7b Mon Sep 17 00:00:00 2001 From: huangdijia Date: Tue, 2 Feb 2016 11:43:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B7=AF=E7=94=B1,=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=BB=A5=E4=B8=8B=E5=86=99=E6=B3=95=20Route::domain('?= =?UTF-8?q?www',=20function(){=20=20=20=20=20Route::register(':action',=20?= =?UTF-8?q?'index/Index/:action');=20=20=20=20=20Route::register(':hash',?= =?UTF-8?q?=20'index/Index/redirect=3Ftype=3Dshort');=20=20=20=20=20Route:?= =?UTF-8?q?:register('d/:hash',=20'index/Index/redirect=3Ftype=3Dqrcode');?= =?UTF-8?q?=20});?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 8984025f..72201ebd 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -327,6 +327,11 @@ class Route // 检测URL路由 public static function check($url, $depr = '/', $checkDomain = false) { + // 检测域名部署 + if ($checkDomain) { + self::checkDomain(); + } + // 分隔符替换 确保路由定义使用统一的分隔符 if ('/' != $depr) { $url = str_replace($depr, '/', $url); @@ -350,11 +355,6 @@ class Route $rules = array_merge(self::$rules['*'], $rules); } - // 检测域名部署 - if ($checkDomain) { - self::checkDomain(); - } - // 检测URL绑定 $return = self::checkUrlBind($url, $rules); if ($return) {