From 9c2323cf26955d4d3df5cd1943268f4cdf298645 Mon Sep 17 00:00:00 2001 From: dengjingyuan <602754659@qq.com> Date: Tue, 23 Nov 2021 10:27:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E6=8F=92=E4=BB=B6appid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/Utils.php | 2 ++ src/Http/Server.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Common/Utils.php b/src/Common/Utils.php index 29a035d..22a76f7 100644 --- a/src/Common/Utils.php +++ b/src/Common/Utils.php @@ -240,6 +240,8 @@ class Utils 'config' => $configPath, 'routes' => $routesPath ]; + $pluginDir = explode(DIRECTORY_SEPARATOR, $basePath); + $config['plugin_dirname'] = end($pluginDir); if ($all) { $plugins[$config['app_id']] = $config; } else { diff --git a/src/Http/Server.php b/src/Http/Server.php index 3480ef6..d2327b9 100644 --- a/src/Http/Server.php +++ b/src/Http/Server.php @@ -87,7 +87,7 @@ class Server extends SiteApp $prefix = '/plugin/' . $plugin['name_en'] . '/api/'; $route->group($prefix, function (RouteCollection $route) use ($plugin) { $pluginFiles = $plugin['plugin_' . $plugin['app_id']]; - \App\Common\Utils::setPluginAppId($plugin['app_id']); + \App\Common\Utils::setPluginAppId($plugin['plugin_dirname'], $plugin['app_id']); if (isset($pluginFiles['routes'])) { foreach ($pluginFiles['routes'] as $routeFile) { require_once $routeFile; -- Gitee