diff --git a/app/handle/controller/Log.php b/app/handle/controller/Log.php index 7f3622a..5037bb9 100644 --- a/app/handle/controller/Log.php +++ b/app/handle/controller/Log.php @@ -11,7 +11,8 @@ class Log public function report(): Json { if (!Request::instance()->isPost()) return json(['status' => 0]); - $data = Request::instance()->post(); + $raw = file_get_contents('php://input'); + $data = json_decode($raw, true) ?: Request::instance()->post(); \app\utils\Logger::error(\app\utils\Logger::CAT_FRONTEND, $data['message'] ?? 'unknown', [ 'source' => $data['source'] ?? 'unknown', 'type' => $data['type'] ?? 'error', diff --git a/app/index/controller/Log.php b/app/index/controller/Log.php index 8c367fc..8062ef5 100644 --- a/app/index/controller/Log.php +++ b/app/index/controller/Log.php @@ -11,7 +11,8 @@ class Log public function report(): Json { if (!Request::instance()->isPost()) return json(['status' => 0]); - $data = Request::instance()->post(); + $raw = file_get_contents('php://input'); + $data = json_decode($raw, true) ?: Request::instance()->post(); \app\utils\Logger::error(\app\utils\Logger::CAT_FRONTEND, $data['message'] ?? 'unknown', [ 'source' => $data['source'] ?? 'unknown', 'type' => $data['type'] ?? 'error',