From 0b2359e856f1d4c902a0b1e70fd906be8a584f87 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 7 Jun 2016 18:46:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E8=B7=AF=E7=94=B1=E5=88=B0?= =?UTF-8?q?=E7=B1=BB=E7=9A=84=E6=96=B9=E6=B3=95=E7=9A=84=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 3 ++- library/think/exception/Handle.php | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index c7ef23ff..bd36215b 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -1041,7 +1041,8 @@ class Route $result = ['type' => 'redirect', 'url' => $url, 'status' => (is_array($route) && isset($route[1])) ? $route[1] : 301]; } elseif (0 === strpos($url, '\\')) { // 路由到方法 - $result = ['type' => 'method', 'method' => is_array($route) ? [$url, $route[1]] : $url, 'params' => $matches]; + $method = strpos($url, '@') ? explode('@', $url) : $url; + $result = ['type' => 'method', 'method' => $method, 'params' => $matches]; } elseif (0 === strpos($url, '@')) { // 路由到控制器 $result = ['type' => 'controller', 'controller' => substr($url, 1), 'params' => $matches]; diff --git a/library/think/exception/Handle.php b/library/think/exception/Handle.php index 1a2dbc61..0946b941 100644 --- a/library/think/exception/Handle.php +++ b/library/think/exception/Handle.php @@ -145,6 +145,7 @@ class Handle // 不显示详细错误信息 $data['message'] = Config::get('error_message'); } + //保留一层 while (ob_get_level() > 1) { ob_end_clean(); @@ -154,8 +155,7 @@ class Handle extract($data); include Config::get('exception_tmpl'); // 获取并清空缓存 - $content = ob_get_clean(); - + $content = ob_get_clean(); $response = new Response($content, 'html'); if ($exception instanceof HttpException) { @@ -167,7 +167,6 @@ class Handle $statusCode = 500; } $response->code($statusCode); - return $response; }