提交者
Gitee
!240 修复管理员日志中的标题获取
Merge pull request !240 from DonsonLau/master
正在显示
1 个修改的文件
包含
6 行增加
和
2 行删除
@@ -4,6 +4,7 @@ namespace app\admin\model; | @@ -4,6 +4,7 @@ namespace app\admin\model; | ||
4 | 4 | ||
5 | use app\admin\library\Auth; | 5 | use app\admin\library\Auth; |
6 | use think\Model; | 6 | use think\Model; |
7 | +use think\Loader; | ||
7 | 8 | ||
8 | class AdminLog extends Model | 9 | class AdminLog extends Model |
9 | { | 10 | { |
@@ -45,11 +46,14 @@ class AdminLog extends Model | @@ -45,11 +46,14 @@ class AdminLog extends Model | ||
45 | $title = self::$title; | 46 | $title = self::$title; |
46 | if (!$title) { | 47 | if (!$title) { |
47 | $title = []; | 48 | $title = []; |
48 | - $breadcrumb = Auth::instance()->getBreadcrumb(); | 49 | + $controllername = Loader::parseName(request()->controller()); |
50 | + $actionname = strtolower(request()->action()); | ||
51 | + $path = str_replace('.', '/', $controllername) . '/' . $actionname; | ||
52 | + $breadcrumb = Auth::instance()->getBreadcrumb($path); | ||
49 | foreach ($breadcrumb as $k => $v) { | 53 | foreach ($breadcrumb as $k => $v) { |
50 | $title[] = $v['title']; | 54 | $title[] = $v['title']; |
51 | } | 55 | } |
52 | - $title = implode(' ', $title); | 56 | + $title = implode(' / ', $title); |
53 | } | 57 | } |
54 | self::create([ | 58 | self::create([ |
55 | 'title' => $title, | 59 | 'title' => $title, |
-
请 注册 或 登录 后发表评论