diff --git a/library/think/Route.php b/library/think/Route.php index 609b4ae6..73bd8bff 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -697,11 +697,12 @@ class Route $module = APP_MULTI_MODULE ? array_shift($path) : null; if ($autoSearch) { // 自动搜索控制器 - $dir = APP_PATH . ($module ? $module . DS : '') . CONTROLLER_LAYER; - $item = []; + $dir = APP_PATH . ($module ? $module . DS : '') . CONTROLLER_LAYER; + $suffix = CLASS_APPEND_SUFFIX || Config::get('use_controller_suffix') ? ucfirst(CONTROLLER_LAYER) : ''; + $item = []; foreach ($path as $val) { $item[] = array_shift($path); - if (is_file($dir . DS . $val . EXT)) { + if (is_file($dir . DS . $val . $suffix . EXT)) { break; } else { $dir .= DS . $val;