From 1473fd93cfe674b51a0127c12c2c6a8f74926ba9 Mon Sep 17 00:00:00 2001 From: Donson <2426531933@qq.com> Date: Mon, 21 Sep 2020 11:45:50 +0800 Subject: [PATCH] 修复管理员日志中的标题获取 --- application/admin/model/AdminLog.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/admin/model/AdminLog.php b/application/admin/model/AdminLog.php index e0d92af..2fbb688 100644 --- a/application/admin/model/AdminLog.php +++ b/application/admin/model/AdminLog.php @@ -4,6 +4,7 @@ namespace app\admin\model; use app\admin\library\Auth; use think\Model; +use think\Loader; class AdminLog extends Model { @@ -45,11 +46,14 @@ class AdminLog extends Model $title = self::$title; if (!$title) { $title = []; - $breadcrumb = Auth::instance()->getBreadcrumb(); + $controllername = Loader::parseName(request()->controller()); + $actionname = strtolower(request()->action()); + $path = str_replace('.', '/', $controllername) . '/' . $actionname; + $breadcrumb = Auth::instance()->getBreadcrumb($path); foreach ($breadcrumb as $k => $v) { $title[] = $v['title']; } - $title = implode(' ', $title); + $title = implode(' / ', $title); } self::create([ 'title' => $title, -- libgit2 0.24.0