From 079f6df9dd5c82130635537f6c79b3801a6d25ad Mon Sep 17 00:00:00 2001 From: Karson Date: Fri, 27 May 2022 15:01:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=9F=E6=88=90=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=B7=A5=E5=85=B7=E6=A0=8F=E6=8C=89=E9=92=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/common.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/admin/common.php b/application/admin/common.php index 14fcb5e8..502c5348 100755 --- a/application/admin/common.php +++ b/application/admin/common.php @@ -4,6 +4,7 @@ use app\common\model\Category; use fast\Form; use fast\Tree; use think\Db; +use think\Loader; if (!function_exists('build_select')) { @@ -102,7 +103,7 @@ if (!function_exists('build_toolbar')) { function build_toolbar($btns = null, $attr = []) { $auth = \app\admin\library\Auth::instance(); - $controller = str_replace('.', '/', strtolower(think\Request::instance()->controller())); + $controller = str_replace('.', '/', Loader::parseName(request()->controller())); $btns = $btns ? $btns : ['refresh', 'add', 'edit', 'del', 'import']; $btns = is_array($btns) ? $btns : explode(',', $btns); $index = array_search('delete', $btns); @@ -175,7 +176,7 @@ if (!function_exists('build_heading')) { $title = $content = ''; if (is_null($path)) { $action = request()->action(); - $controller = str_replace('.', '/', request()->controller()); + $controller = str_replace('.', '/', Loader::parseName(request()->controller())); $path = strtolower($controller . ($action && $action != 'index' ? '/' . $action : '')); } // 根据当前的URI自动匹配父节点的标题和备注