Skip to content

Commit

Permalink
fix: 修复目录扫找工具
Browse files Browse the repository at this point in the history
  • Loading branch information
zoujingli committed Oct 16, 2024
1 parent dc7ad97 commit f2e3487
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/service/NodeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static function getMethods(bool $force = false): array
$ignoreMethods = get_class_methods('\think\admin\Controller');
$ignoreAppNames = Library::$sapp->config->get('app.rbac_ignore', []);
// 扫描所有代码控制器节点,更新节点缓存
foreach (ToolsExtend::scanDirectory(Library::$sapp->getBasePath(), 'php') as $name) {
foreach (ToolsExtend::scanDirectory(Library::$sapp->getBasePath(), null, 'php') as $name) {
if (preg_match("|^(\w+)/controller/(.+)\.php$|i", strtr($name, '\\', '/'), $matches)) {
[, $appName, $className] = $matches;
if (in_array($appName, $ignoreAppNames)) continue;
Expand All @@ -130,7 +130,7 @@ public static function getMethods(bool $force = false): array
foreach (Plugin::get() as $appName => $plugin) {
if (in_array($appName, $ignoreAppNames)) continue;
[$appPath, $appSpace] = [$plugin['path'], $plugin['space']];
foreach (ToolsExtend::scanDirectory($appPath, 'php') as $name) {
foreach (ToolsExtend::scanDirectory($appPath, null, 'php') as $name) {
if (preg_match("|^.*?controller/(.+)\.php$|i", strtr($name, '\\', '/'), $matches)) {
static::_parseClass($appName, $appSpace, $matches[1], $ignoreMethods, $data);
}
Expand Down

0 comments on commit f2e3487

Please sign in to comment.