mirror of https://gitee.com/karson/fastadmin.git
优化管理员日志记录
parent
d6ef94c573
commit
7754cf4c3c
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace app\admin\controller;
|
namespace app\admin\controller;
|
||||||
|
|
||||||
|
use app\admin\model\AdminLog;
|
||||||
use app\common\controller\Backend;
|
use app\common\controller\Backend;
|
||||||
use app\common\exception\UploadException;
|
use app\common\exception\UploadException;
|
||||||
use app\common\library\Upload;
|
use app\common\library\Upload;
|
||||||
|
|
@ -73,6 +74,9 @@ class Ajax extends Backend
|
||||||
//必须还原upload配置,否则分片及cdnurl函数计算错误
|
//必须还原upload配置,否则分片及cdnurl函数计算错误
|
||||||
Config::load(APP_PATH . 'extra/upload.php', 'upload');
|
Config::load(APP_PATH . 'extra/upload.php', 'upload');
|
||||||
|
|
||||||
|
//自定义日志标题
|
||||||
|
AdminLog::setTitle(__('Upload'));
|
||||||
|
|
||||||
$chunkid = $this->request->post("chunkid");
|
$chunkid = $this->request->post("chunkid");
|
||||||
if ($chunkid) {
|
if ($chunkid) {
|
||||||
if (!Config::get('upload.chunking')) {
|
if (!Config::get('upload.chunking')) {
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ class AdminLog extends Model
|
||||||
//忽略的链接正则列表
|
//忽略的链接正则列表
|
||||||
protected static $ignoreRegex = [
|
protected static $ignoreRegex = [
|
||||||
'/^(.*)\/(selectpage|index)$/i',
|
'/^(.*)\/(selectpage|index)$/i',
|
||||||
|
'/^(.*)\/addon\/get_table_list$/i',
|
||||||
];
|
];
|
||||||
|
|
||||||
public static function setTitle($title)
|
public static function setTitle($title)
|
||||||
|
|
@ -69,14 +70,7 @@ class AdminLog extends Model
|
||||||
$content = self::getPureContent($content);
|
$content = self::getPureContent($content);
|
||||||
}
|
}
|
||||||
$title = $title ?: self::$title;
|
$title = $title ?: self::$title;
|
||||||
if (!$title) {
|
$title = $title ?: implode(' / ', array_column(Auth::instance()->getBreadcrumb($path), 'title'));
|
||||||
$title = [];
|
|
||||||
$breadcrumb = Auth::instance()->getBreadcrumb($path);
|
|
||||||
foreach ($breadcrumb as $k => $v) {
|
|
||||||
$title[] = $v['title'];
|
|
||||||
}
|
|
||||||
$title = implode(' / ', $title);
|
|
||||||
}
|
|
||||||
self::create([
|
self::create([
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'content' => !is_scalar($content) ? json_encode($content, JSON_UNESCAPED_UNICODE) : $content,
|
'content' => !is_scalar($content) ? json_encode($content, JSON_UNESCAPED_UNICODE) : $content,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue