This commit is contained in:
2024-10-29 14:04:59 +08:00
commit 48bf3e6f33
2839 changed files with 762707 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
<?php
namespace app\admin\behavior;
use think\Log;
use think\Request;
use think\Session;
class UserAction {
private $Request;
/**
* 日志记录
*/
public function run($call) {
$this->Request = Request::instance();
$domainurl = $this->Request->url(true);
$module = $this->Request->module();
$controller = $this->Request->controller();
$action = $this->Request->action();
$method = $this->Request->method();
switch ($controller) {
case 'Translate':
action_log($controller . '控制器' . $action . '动作操作记录', "翻译操作记录{$module}-{$controller}-{$action}-{$method}-" . date('Y-m-d H:i:s'), null);
break;
case 'Webuploader':
action_log($controller . '控制器' . $action . '动作操作记录', "文件管理操作记录{$module}-{$controller}-{$action}-{$method}-" . date('Y-m-d H:i:s'), null);
break;
case 'Dbmanager':
action_log($controller . '控制器' . $action . '动作操作记录', "数据管理操作记录{$module}-{$controller}-{$action}-{$method}-" . date('Y-m-d H:i:s'), null);
break;
case 'Sysconfig':
action_log($controller . '控制器' . $action . '动作操作记录', "系统配置管理操作记录{$module}-{$controller}-{$action}-{$method}-" . date('Y-m-d H:i:s'), null);
break;
case 'Ueditor':
action_log($controller . '控制器' . $action . '动作操作记录', "编辑器操作记录{$module}-{$controller}-{$action}-{$method}-" . date('Y-m-d H:i:s'), null);
break;
default:
$actions = ['create', 'update', 'delete', 'deletes', 'distory', 'distorys', 'recovery', 'recoverys', 'setting', 'recycle', 'recommends'];
if (in_array($action, $actions) || stripos($action, 'toggle') === 0 || stripos($action, 'update') === 0) {
action_log($controller . '控制器' . $action . '动作操作记录', "{$module}-{$controller}-{$action}-{$method}-" . date('Y-m-d H:i:s'), null);
}
break;
}
}
}