From bbb53484bcaa939d063cd6430838a533189f0304 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 16 Jun 2016 18:23:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRoute=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E5=88=86=E7=BB=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 45cb384c..9cd55661 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -211,8 +211,6 @@ class Route public static function rule($rule, $route = '', $type = '*', $option = [], $pattern = [], $group = '') { $group = $group ?: self::$group; - $option = $option ? array_merge(self::$option, $option) : self::$option; - $type = strtoupper($type); if (strpos($type, '|')) { foreach (explode('|', $type) as $val) { @@ -665,7 +663,7 @@ class Route if (!empty(self::$rules['*'])) { // 合并任意请求的路由规则 - $rules = array_merge(self::$rules['*'], $rules); + $rules = array_merge_recursive(self::$rules['*'], $rules); } // 检测域名部署 @@ -721,7 +719,7 @@ class Route $pattern = array_merge($pattern, isset($route[2]) ? $route[2] : []); $route = $route[0]; $option = array_merge($option, $option1); - } + }dump($option); $result = self::checkRule($key, $route, $url, $pattern, $option); if (false !== $result) { $request->route(['rule' => $key, 'route' => $route, 'pattern' => $pattern, 'option' => $option]);