Skip to content

Commit

Permalink
修正分组多级路由合并检查
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Dec 26, 2024
1 parent 97783b6 commit ac14f53
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/think/route/RuleGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ protected function checkMergeRuleRegex(Request $request, array &$rules, string $
$regex[$key] = $this->buildRuleRegex($rule, $matches[0], $pattern, $option, $complete, '_THINK_' . $key);
$items[$key] = $item;
}
} elseif ($item instanceof RuleGroup) {
$array = $item->getrules();
return $this->checkMergeRuleRegex($request, $array, ltrim($url, $depr), $completeMatch);
}
}

Expand Down Expand Up @@ -420,7 +423,7 @@ public function class(string $class, bool $prefix = true)
{
$this->bind = '\\' . $class;
if ($prefix) {
$this->prefix('\\' . $class . '@');
$this->prefix('\\' . $class . '@');
}
return $this;
}
Expand All @@ -436,7 +439,7 @@ public function controller(string $controller, bool $prefix = true)
{
$this->bind = '@' . $controller;
if ($prefix) {
$this->prefix($controller . '/');
$this->prefix($controller . '/');
}
return $this;
}
Expand All @@ -452,7 +455,7 @@ public function namespace(string $namespace, bool $prefix = true)
{
$this->bind = ':' . $namespace;
if ($prefix) {
$this->prefix($namespace . '\\');
$this->prefix($namespace . '\\');
}
return $this;
}
Expand All @@ -468,7 +471,7 @@ public function layer(string $layer, bool $prefix = true)
{
$this->bind = '/' . $layer;
if ($prefix) {
$this->prefix($layer . '/');
$this->prefix($layer . '/');
}
return $this;
}
Expand Down

0 comments on commit ac14f53

Please sign in to comment.