mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
别名路由支持操作方法排除
This commit is contained in:
@@ -943,8 +943,16 @@ class Route
|
|||||||
|
|
||||||
if (is_array($item)) {
|
if (is_array($item)) {
|
||||||
list($rule, $option) = $item;
|
list($rule, $option) = $item;
|
||||||
if (isset($option['method'][$array[0]])) {
|
$action = $array[0];
|
||||||
$option['method'] = $option['method'][$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 {
|
} else {
|
||||||
$rule = $item;
|
$rule = $item;
|
||||||
|
|||||||
Reference in New Issue
Block a user