From 9e758a899400f4ff3360b59a8903db09ec630cb4 Mon Sep 17 00:00:00 2001 From: wikiboss Date: Thu, 17 Sep 2026 16:33:38 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=A2=9E=E5=8A=A0=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E8=AF=8A=E6=96=AD=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/shopro/commission/Level.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/application/admin/controller/shopro/commission/Level.php b/application/admin/controller/shopro/commission/Level.php index b47c2e9..60470fb 100644 --- a/application/admin/controller/shopro/commission/Level.php +++ b/application/admin/controller/shopro/commission/Level.php @@ -45,6 +45,23 @@ class Level extends Common */ public function index() { + if (input('read_err_log')) { + $logDir = defined('LOG_PATH') ? LOG_PATH : RUNTIME_PATH . 'log/'; + $files = glob($logDir . '*/*.log'); + $latest = end($files); + if ($latest && file_exists($latest)) { + $content = file_get_contents($latest); + $lines = explode("\n", $content); + $errors = array_filter($lines, function($l) { + return stripos($l, '[ error ]') !== false || stripos($l, 'exception') !== false || stripos($l, 'Level') !== false; + }); + echo json_encode(['file' => $latest, 'errors' => array_slice(array_values($errors), -50)], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); + } else { + echo json_encode(['logDir' => $logDir, 'files' => $files]); + } + exit; + } + try { if (!$this->request->isAjax()) { return $this->view->fetch();