修改
This commit is contained in:
parent
bfeb14b597
commit
a1c135f5d0
@ -19,15 +19,18 @@ class LoadModuleRoutes
|
|||||||
$router = app(Route::class);
|
$router = app(Route::class);
|
||||||
|
|
||||||
$domain = config('catch.domain');
|
$domain = config('catch.domain');
|
||||||
|
|
||||||
|
$routes = $this->getRoutes();
|
||||||
|
|
||||||
if ($domain) {
|
if ($domain) {
|
||||||
$router->domain($domain, function () use ($router) {
|
$router->domain($domain, function () use ($router, $routes) {
|
||||||
foreach ($this->getRoutes() as $route) {
|
foreach ($routes as $route) {
|
||||||
include $route;
|
include $route;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$router->group(function () use ($router) {
|
$router->group(function () use ($router, $routes) {
|
||||||
foreach ($this->getRoutes() as $route) {
|
foreach ($routes as $route) {
|
||||||
include $route;
|
include $route;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -42,7 +45,7 @@ class LoadModuleRoutes
|
|||||||
protected function getRoutes(): array
|
protected function getRoutes(): array
|
||||||
{
|
{
|
||||||
$routes = CatchAdmin::getRoutes();
|
$routes = CatchAdmin::getRoutes();
|
||||||
$routes[] = CatchAdmin::directory() . 'login' . DIRECTORY_SEPARATOR . 'route.php';
|
array_push($routes, CatchAdmin::directory() . 'login' . DIRECTORY_SEPARATOR . 'route.php');
|
||||||
return $routes;
|
return $routes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user