From 245dba00a7023437d31a01a85f12e8cf9d9a9e49 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 12 Oct 2016 22:07:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=AB=E5=90=8D=E8=B7=AF=E7=94=B1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=93=8D=E4=BD=9C=E6=96=B9=E6=B3=95=E6=8E=92=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 8f7dbe76..98bca3d4 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -943,8 +943,16 @@ class Route if (is_array($item)) { list($rule, $option) = $item; - if (isset($option['method'][$array[0]])) { - $option['method'] = $option['method'][$array[0]]; + $action = $array[0]; + if (isset($option['except'])) { + // 排除操作 + $except = is_string($option['except']) ? explode(',', $option['except']) : $option['except']; + if (in_array($action, $except)) { + return false; + } + } + if (isset($option['method'][$action])) { + $option['method'] = $option['method'][$action]; } } else { $rule = $item;