[''], 'allow' => ['dataRecord', 'systemRecord', 'loginRecord'] ]; Hook::listen('check_auth',$action); $request = Request::instance(); $a = strtolower($request->action()); if (!in_array($a, $action['permission'])) { parent::_initialize(); } } /** * 数据操作日志 * * @param LogLogic $logLogic * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function dataRecord(LogLogic $logLogic) { $data['list'] = $logLogic->getRecordLogs($this->param); $data['count'] = $logLogic->getRecordLogCount($this->param); $data['modules'] = $logLogic->recordModules; return resultArray(['data' => $data]); } /** * 系统操作日志 * * @param LogLogic $logLogic * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function systemRecord(LogLogic $logLogic) { $data['list'] = $logLogic->getSystemLogs($this->param); $data['count'] = $logLogic->getSystemLogCount($this->param); $data['modules'] = $logLogic->systemModules; return resultArray(['data' => $data]); } /** * 登录日志 * * @param LogLogic $logLogic * @return \think\response\Json * @throws \think\exception\DbException */ public function loginRecord(LogLogic $logLogic) { $data = $logLogic->getLoginRecord($this->param); return resultArray(['data' => $data]); } }