From c593b8b5bfb8c1c9f1ad2d5ea6529d8f2e494b0a Mon Sep 17 00:00:00 2001 From: make Date: Mon, 12 May 2025 20:21:39 +0800 Subject: [PATCH] debug --- code/app/services/SiteContext.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/code/app/services/SiteContext.php b/code/app/services/SiteContext.php index a5c138b..1bf1fe6 100644 --- a/code/app/services/SiteContext.php +++ b/code/app/services/SiteContext.php @@ -321,10 +321,29 @@ class SiteContext */ public function initVideoCategoryTypeTKD() { - $strParentCategory = $this->Request->param('strParentCategory'); + // 获取分类参数并进行安全处理 + $strParentCategory = trim($this->Request->param('strParentCategory', '')); + + // 初始化分类名称 + $strVideoParentCategoryName = ''; + + // 检查分类是否有效 + if (!empty($strParentCategory) && $strParentCategory !== 'all' && array_key_exists($strParentCategory, StaticConfig::$arrVideoClass)) { + $strVideoParentCategoryName = StaticConfig::$arrVideoClass[$strParentCategory]; + } + // 设置分类名称 ConverterMovel::setVal([ - 'strVideoParentCategoryName' => empty($strParentCategory) || $strParentCategory == 'all' ? '' : StaticConfig::$arrVideoClass[$strParentCategory], + 'strVideoParentCategoryName' => $strVideoParentCategoryName, ]); + + // $strParentCategory = $this->Request->param('strParentCategory'); + + // if (array_key_exists($strParentCategory, StaticConfig::$arrVideoClass)) { + + // } + // ConverterMovel::setVal([ + // 'strVideoParentCategoryName' => empty($strParentCategory) || $strParentCategory == 'all' ? '' : StaticConfig::$arrVideoClass[$strParentCategory], + // ]); } /**