mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-04 14:22:48 +08:00
路由配置文件支持多个 使用 route_config_file 配置参数配置
This commit is contained in:
@@ -33,9 +33,14 @@ class Route extends Command
|
||||
|
||||
protected function buildRouteCache()
|
||||
{
|
||||
$config = include CONF_PATH . 'route' . CONF_EXT;
|
||||
if ($config) {
|
||||
\think\Route::import($config);
|
||||
$files = \think\Config::get('route_config_file');
|
||||
foreach ($files as $file) {
|
||||
if (is_file(CONF_PATH . $file . CONF_EXT)) {
|
||||
$config = include CONF_PATH . $file . CONF_EXT;
|
||||
if ($config) {
|
||||
\think\Route::import($config);
|
||||
}
|
||||
}
|
||||
}
|
||||
$rules = \think\Route::rules(true);
|
||||
array_walk_recursive($rules, [$this, 'buildClosure']);
|
||||
|
||||
Reference in New Issue
Block a user