From 58780d959b3b47f9c0e44607eae941e40f90513c Mon Sep 17 00:00:00 2001 From: yiqiu Date: Sun, 28 Dec 2025 16:12:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addon/theme_configurator/controller/ThemeController.php | 3 +++ plugins/addon/theme_configurator/model/ThemeConfigModel.php | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/plugins/addon/theme_configurator/controller/ThemeController.php b/plugins/addon/theme_configurator/controller/ThemeController.php index a9c4a5c..4dac2bc 100644 --- a/plugins/addon/theme_configurator/controller/ThemeController.php +++ b/plugins/addon/theme_configurator/controller/ThemeController.php @@ -17,8 +17,11 @@ class ThemeController extends PluginAdminBaseController */ public function config(): Response { + // 调试日志 + error_log('ThemeController::config() 被调用'); $model = new ThemeConfigModel(); $config = $model->getConfig(); + error_log('读取到的配置: ' . json_encode($config)); return json([ 'status' => 200, diff --git a/plugins/addon/theme_configurator/model/ThemeConfigModel.php b/plugins/addon/theme_configurator/model/ThemeConfigModel.php index c3fb3b1..90970d8 100644 --- a/plugins/addon/theme_configurator/model/ThemeConfigModel.php +++ b/plugins/addon/theme_configurator/model/ThemeConfigModel.php @@ -34,6 +34,8 @@ class ThemeConfigModel */ public function getConfig(): array { + // 临时禁用缓存读取用于调试 + /* // 尝试从缓存获取 try { $config = Cache::get(self::CACHE_KEY); @@ -45,6 +47,7 @@ class ThemeConfigModel } catch (\Throwable $e) { // 缓存系统异常,继续从数据库读取 } + */ // 缓存未命中,从数据库读取 $row = $this->query()->order('id', 'asc')->find(); @@ -55,12 +58,15 @@ class ThemeConfigModel $config = is_array($config) ? $config : $this->defaultConfig(); } + // 临时禁用缓存写入用于调试 + /* // 写入缓存 (忽略缓存写入失败) try { Cache::set(self::CACHE_KEY, $config, self::CACHE_TTL); } catch (\Throwable $e) { // 忽略缓存写入失败 } + */ return $config; }