diff --git a/library/think/Route.php b/library/think/Route.php index 205999a5..5a4a1f42 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -232,6 +232,7 @@ class Route public static function rule($rule, $route = '', $type = '*', $option = [], $pattern = []) { $group = self::getGroup('name'); + if (!is_null($group)) { // 路由分组 $option = array_merge(self::getGroup('option'), $option); @@ -307,6 +308,9 @@ class Route $key = $group ? $group . ($rule ? '/' . $rule : '') : $rule; self::name($name, [$key, $vars, self::$domain]); } + if (isset($option['modular'])) { + $route = $option['modular'] . '/' . $route; + } if ($group) { if ('*' != $type) { $option['method'] = $type;