From 867a514758be4171f3a1e5cd2071f9dc5f627e3a Mon Sep 17 00:00:00 2001 From: make Date: Fri, 9 Jan 2026 22:06:58 +0800 Subject: [PATCH] debug --- code/app/services/SiteContext.php | 3 +++ code/config/view.php | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/code/app/services/SiteContext.php b/code/app/services/SiteContext.php index b883acd..69c05d7 100644 --- a/code/app/services/SiteContext.php +++ b/code/app/services/SiteContext.php @@ -190,6 +190,9 @@ class SiteContext // 1. 站点 DNA $TpStyle = $this->TpStyle; + define('SITE_SEED', $TpStyle['seed']); // 你已有的站点 seed + + // 3. 构建本域名 CSS(合并并替换 __PFX__) $strCssUrl = CssBuilder::build( $TpStyle['css_files'], diff --git a/code/config/view.php b/code/config/view.php index bf7378a..0027bdf 100644 --- a/code/config/view.php +++ b/code/config/view.php @@ -35,6 +35,11 @@ return [ // 是否开启模板编译缓存,设为false则每次都会重新编译 'tpl_cache' => env('VIEW_TPL_CACHE', false), + // ⭐⭐⭐ 关键:模板编译缓存隔离前缀(防止多域名串模板) + 'cache_prefix' => md5( + ($_SERVER['HTTP_HOST'] ?? 'cli') . '|' . (defined('SITE_SEED') ? SITE_SEED : '') + ), + //页面数据缓存 'view_data_cache' => env('VIEW_DATA_CACHE', false),