From e9122c5850a6ee502f8b02a848879d9d422dd6bc Mon Sep 17 00:00:00 2001 From: zhenhui <1276357500@qq.com> Date: Thu, 2 Apr 2026 11:36:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=AE=A1=E7=90=86=E5=8F=AA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=BB=84=E4=BB=A5=E5=8F=8A=E4=BB=A5=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/functions.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/functions.php b/app/functions.php index 18b52be..bfd4e4f 100644 --- a/app/functions.php +++ b/app/functions.php @@ -188,7 +188,8 @@ if (!function_exists('get_controller_path')) { $parts = explode('\\', $relative); $path = []; foreach ($parts as $p) { - $path[] = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $p)); + // 与 BuildAdmin admin_rule.name 一致:多段类名用 camelCase(如 auth/adminLog),不用 admin_log + $path[] = lcfirst($p); } return implode('/', $path); } @@ -215,10 +216,10 @@ if (!function_exists('get_controller_path')) { $dotPos = strpos($seg, '.'); $mod = substr($seg, 0, $dotPos); $ctrl = substr($seg, $dotPos + 1); - $normalized[] = strtolower($mod); - $normalized[] = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $ctrl)); + $normalized[] = lcfirst($mod); + $normalized[] = lcfirst($ctrl); } else { - $normalized[] = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $seg)); + $normalized[] = lcfirst($seg); } } return implode('/', $normalized);