diff --git a/beike/Services/DesignService.php b/beike/Services/DesignService.php index 0f4286a8..d6d26af7 100644 --- a/beike/Services/DesignService.php +++ b/beike/Services/DesignService.php @@ -156,6 +156,7 @@ class DesignService private static function handleRichText($content): array { $content['data'] = $content['text'][locale()] ?? ''; + return $content; } diff --git a/beike/Shop/Providers/PluginServiceProvider.php b/beike/Shop/Providers/PluginServiceProvider.php index 4f3939a8..ba392a32 100644 --- a/beike/Shop/Providers/PluginServiceProvider.php +++ b/beike/Shop/Providers/PluginServiceProvider.php @@ -45,17 +45,18 @@ class PluginServiceProvider extends ServiceProvider $this->pluginBasePath = base_path('plugins'); foreach ($plugins as $plugin) { + $pluginCode = $plugin->getDirname(); $this->bootPlugin($plugin); + $this->registerRoutes($pluginCode); + $this->registerMiddleware($pluginCode); } $allPlugins = $manager->getPlugins(); foreach ($allPlugins as $plugin) { $pluginCode = $plugin->getDirname(); $this->loadMigrations($pluginCode); - $this->loadRoutes($pluginCode); $this->loadViews($pluginCode); $this->loadTranslations($pluginCode); - $this->registerMiddleware($pluginCode); } } @@ -90,11 +91,11 @@ class PluginServiceProvider extends ServiceProvider } /** - * 加载插件路由 + * 加载插件路由并注册 * * @param $pluginCode */ - private function loadRoutes($pluginCode) + private function registerRoutes($pluginCode) { $pluginBasePath = $this->pluginBasePath; $shopRoutePath = "{$pluginBasePath}/{$pluginCode}/Routes/shop.php";