Skip to content

Commit ced4837

Browse files
committed
改进Controller调度类
1 parent 1f6a5b5 commit ced4837

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/think/route/dispatch/Controller.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,19 @@ class Controller extends Dispatch
4545
public function init(App $app)
4646
{
4747
$this->app = $app;
48-
$this->parseDispatch();
48+
$this->parseDispatch($this->dispatch);
4949
$this->doRouteAfter();
5050
}
5151

52-
protected function parseDispatch()
52+
protected function parseDispatch($path)
5353
{
54-
$path = $this->dispatch;
5554
if (is_string($path)) {
5655
$path = explode('/', $path);
5756
}
5857

5958
$action = !empty($path) ? array_pop($path) : $this->rule->config('default_action');
6059
$controller = !empty($path) ? array_pop($path) : $this->rule->config('default_controller');
61-
$layer = !empty($path) ? implode('\\', $path) : '';
60+
$layer = !empty($path) ? implode('/', $path) : '';
6261

6362
if ($layer && !empty($this->option['auto_middleware'])) {
6463
// 自动为顶层layer注册中间件

0 commit comments

Comments
 (0)