mirror of https://gitee.com/karson/fastadmin.git
修复管理员日志中的标题获取
parent
aa5d413cc0
commit
1473fd93cf
|
|
@ -4,6 +4,7 @@ namespace app\admin\model;
|
||||||
|
|
||||||
use app\admin\library\Auth;
|
use app\admin\library\Auth;
|
||||||
use think\Model;
|
use think\Model;
|
||||||
|
use think\Loader;
|
||||||
|
|
||||||
class AdminLog extends Model
|
class AdminLog extends Model
|
||||||
{
|
{
|
||||||
|
|
@ -45,11 +46,14 @@ class AdminLog extends Model
|
||||||
$title = self::$title;
|
$title = self::$title;
|
||||||
if (!$title) {
|
if (!$title) {
|
||||||
$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) {
|
foreach ($breadcrumb as $k => $v) {
|
||||||
$title[] = $v['title'];
|
$title[] = $v['title'];
|
||||||
}
|
}
|
||||||
$title = implode(' ', $title);
|
$title = implode(' / ', $title);
|
||||||
}
|
}
|
||||||
self::create([
|
self::create([
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue