refactor: 添加不需要记录日志的api过滤

This commit is contained in:
2025-03-25 11:09:12 +08:00
parent 09082f3d05
commit e7b6b002ed

View File

@@ -30,6 +30,12 @@ class OperateLog
Cache::set('sys_restful_api:map:name', $restful_api_name_map);
}
// 忽略日志记录的Api
$ignore_apis = env('ADMIN_API.IGNORE_LOGGING_LIST');
if (in_array($request->pathinfo(), $ignore_apis)) {
return $response;
}
$log = [
'user_id' => $request->uid,
'title' => $restful_api_name_map[$request->method() . '-' . $request->controller() . '/' . $request->action()] ?? '',