From 77e810da86e73c4b255a6f43da769aea1f08551b Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 28 Jul 2016 22:05:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E8=B7=AF=E7=94=B1=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E7=BB=91=E5=AE=9A=E6=A8=A1=E5=9D=97=E5=90=8E=E7=9A=84?= =?UTF-8?q?=20=E8=B7=AF=E7=94=B1=E5=AE=9A=E4=B9=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 0122d660..5aea3e06 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -686,14 +686,14 @@ class Route // 绑定到命名空间 例如 \app\index\behavior self::$bind = ['type' => 'namespace', 'namespace' => $result]; } elseif (0 === strpos($result, '@')) { - // 绑定到类 例如 \app\index\controller\User + // 绑定到类 例如 @app\index\controller\User self::$bind = ['type' => 'class', 'class' => substr($result, 1)]; } elseif (0 === strpos($result, '[')) { // 绑定到分组 例如 [user] self::$bind = ['type' => 'group', 'group' => substr($result, 1, -1)]; } else { // 绑定到模块/控制器 例如 index/user - self::$bind = ['type' => 'module', 'module' => $result]; + self::$bind = ['type' => 'module', 'module' => $result, 'domain' => true]; } } } @@ -879,7 +879,7 @@ class Route return self::bindToNamespace($url, self::$bind['namespace'], $depr); case 'module': // 如果有模块/控制器绑定 针对路由到 模块/控制器 有效 - $url = self::$bind['module'] . '/' . ltrim($url, '/'); + $url = (empty(self::$bind['domain']) ? self::$bind['module'] . '/' : '') . ltrim($url, '/'); break; case 'group': // 绑定到路由分组