feat(admin): add system log switch and optimize log middleware

- Add APP_ADMIN_SYSTEM_LOG environment variable to control admin system logs
- Implement log switch check in SystemLog middleware
- Update .example.env file with new environment variable
This commit is contained in:
wolfcode
2025-01-02 09:58:08 +08:00
parent 88bc6441e5
commit 4baa4e185d
2 changed files with 5 additions and 1 deletions

View File

@@ -34,7 +34,8 @@ class SystemLog
public function handle(Request $request, Closure $next)
{
$response = $next($request);
$params = $request->param();
if (!env('APP_ADMIN_SYSTEM_LOG', true)) return $response;
$params = $request->param();
if (isset($params['s'])) unset($params['s']);
foreach ($params as $key => $val) {
in_array($key, $this->sensitiveParams) && $params[$key] = "***********";