From 01222e8db2724522566112205d99ba0378f8b752 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 9 Jan 2016 16:59:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=BB=91=E5=AE=9A=E5=88=B0na?= =?UTF-8?q?mespace=E7=9A=84=E8=A7=A3=E6=9E=90?= 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 4c3b13ae..0c86281b 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -323,12 +323,12 @@ class Route case 'namespace': // 绑定到命名空间 $array = explode('/', $url, 3); - $class = isset($array[0]) ? $array[0] : ''; - $method = isset($array[1]) ? $array[1] : ''; + $class = isset($array[0]) ? $array[0] : 'index'; + $method = isset($array[1]) ? $array[1] : 'index'; if (isset($array[2])) { self::parseUrlParams($array[2]); } - $return = ['type' => 'class', 'class' => self::$bind['namespace'] . '\\' . $array[0], 'method' => $method, 'params' => []]; + $return = ['type' => 'class', 'class' => self::$bind['namespace'] . '\\' . $class, 'method' => $method, 'params' => []]; break; case 'module': // 如果有模块/控制器绑定 针对路由到 模块/控制器 有效