From bc92b44086fc868bd1fe77e9597d981b8da50ef9 Mon Sep 17 00:00:00 2001 From: make Date: Fri, 11 Apr 2025 23:56:23 +0800 Subject: [PATCH] debug --- code/app/home/BaseController.php | 4 ++ code/app/home/config/router.php | 8 ++- .../view/kuangyu/Novel/getNovelChapter.html | 10 +-- .../kuangyu/Novel/getNovelChapterAll.html | 6 +- .../home/view/kuangyu/Novel/getNovelInfo.html | 4 +- .../view/kuangyu/Pc/Public/articleList.html | 6 +- .../view/kuangyu/Pc/Public/endNovelList.html | 4 +- .../view/kuangyu/Pc/Public/hostListImg.html | 2 +- .../view/kuangyu/Pc/Public/hostListText.html | 2 +- .../kuangyu/Pc/Public/indexBoyNewsList.html | 6 +- .../kuangyu/Pc/Public/indexBoyNewsOne.html | 4 +- .../kuangyu/Pc/Public/indexBoyRankList.html | 4 +- .../kuangyu/Pc/Public/indexBoyRankOne.html | 4 +- .../Pc/Public/indexNewsUpdateList.html | 4 +- .../kuangyu/Pc/Public/shukuNovelList.html | 10 +-- .../view/kuangyu/Pc/Public/swiperListImg.html | 2 +- code/app/home/view/kuangyu/Pc/User/index.html | 26 ++++---- .../home/view/kuangyu/Pc/getArticleInfo.html | 2 +- .../home/view/kuangyu/Pc/getArticleList.html | 36 +++++------ .../home/view/kuangyu/Pc/getKanNovelInfo.html | 30 ++++----- code/app/home/view/kuangyu/Pc/getLibrary.html | 30 ++++----- .../home/view/kuangyu/Pc/getNovelChannel.html | 8 +-- .../home/view/kuangyu/Pc/getNovelChapter.html | 62 +++++++++---------- .../view/kuangyu/Pc/getNovelChapterAll.html | 14 ++--- .../home/view/kuangyu/Pc/getNovelInfo.html | 30 ++++----- .../home/view/kuangyu/Pc/getNovelRank.html | 20 +++--- .../home/view/kuangyu/Pc/getSearchNovel.html | 8 +-- code/app/home/view/kuangyu/Pc/index.html | 16 ++--- code/app/home/view/kuangyu/baseH5.html | 3 + code/app/home/view/kuangyu/baseH5User.html | 3 + code/app/home/view/kuangyu/basePc.html | 19 +++--- code/app/home/view/kuangyu/basePcUser.html | 21 ++++--- .../推广SEO过程设计记录/书库页面设计.md | 4 +- code/app/model/DomainModel.php | 20 +++--- code/database/seeders/TemplateSeeder.php | 14 +++-- code/public/public/js/common.js | 8 +-- .../template/kuangyu/public/js/common.js | 8 +-- 37 files changed, 246 insertions(+), 216 deletions(-) diff --git a/code/app/home/BaseController.php b/code/app/home/BaseController.php index 19e6e94..7510eee 100644 --- a/code/app/home/BaseController.php +++ b/code/app/home/BaseController.php @@ -90,8 +90,12 @@ abstract class BaseController */ public function rending($strTemplate = '') { + // pc端url目录模板 + $strPcUrlPathTemplate = $this->request->DomainModel->getFomartSubject('PC_URL_PATH','',false); + // var_dump($strPcUrlPathTemplate); View::assign("DomainModel", $this->request->DomainModel); View::assign("TemplatesModel", $this->request->TemplatesModel); + View::assign("strPcPath", $strPcUrlPathTemplate); return View::fetch($strTemplate); } diff --git a/code/app/home/config/router.php b/code/app/home/config/router.php index 2ef7f54..bd0ce9e 100644 --- a/code/app/home/config/router.php +++ b/code/app/home/config/router.php @@ -7,7 +7,9 @@ use app\home\controller\Novel; use app\home\controller\User; use think\facade\Route; -// 路由配置文件 +/** + * 路由配置文件 + */ $arrRoutes = [ // H5/PC 端前缀 'prefixes' => [ @@ -106,7 +108,9 @@ $arrRoutes = [ ]; -// 遍历路由配置,动态注册 H5 和 PC 路由 +/** + * 遍历路由配置,动态注册 H5 和 PC 路由 + */ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) { $prefixes = is_array($prefixes) ? $prefixes : [$prefixes]; $boolIsMobile = $platform === 'h5'; diff --git a/code/app/home/view/kuangyu/Novel/getNovelChapter.html b/code/app/home/view/kuangyu/Novel/getNovelChapter.html index ccf2f93..eb99823 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelChapter.html +++ b/code/app/home/view/kuangyu/Novel/getNovelChapter.html @@ -31,12 +31,12 @@ + content="https://{$DomainModel->d_domain}{$strPcPath}/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrChapter.n_id}/zhang-1"> + content="https://{$DomainModel->d_domain}{$strPcPath}/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrChapter.n_id}/zhang-{$arrChapter.c_sort_num}"> @@ -58,14 +58,14 @@ "url": "https://{$DomainModel->d_domain}" }, "image": "{$arrNovel.n_cover_path ?? ''}", - "url": "https://{$DomainModel->d_domain}/pc/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrChapter.c_sort_num ?? 1}", + "url": "https://{$DomainModel->d_domain}{$strPcPath}/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrChapter.c_sort_num ?? 1}", "inLanguage": "zh-CN", "genre": "{$arrNovel.og_novel_category ??''}", "datePublished": "{$arrNovel['og_novel_update_time'] ?? time()}", "hasPart": { "@type": "CreativeWork", "name": "{$arrChapter.name ?? ''}", - "url": "https://{$DomainModel->d_domain}/pc/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrChapter.c_sort_num ?? 1}", + "url": "https://{$DomainModel->d_domain}{$strPcPath}/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrChapter.c_sort_num ?? 1}", "description": "{$strDescription}" } } @@ -344,7 +344,7 @@ //下一章id nextId: '{$arrNextChapter.c_sort_num ?? 1}' }; - book.chapterUrl = '/pc/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrPreChapter.c_sort_num ?? 1}'; + book.chapterUrl = '{$strPcPath}/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrPreChapter.c_sort_num ?? 1}'; book.url = '{site:nurl n_id="$arrNovel[n_id]" n_py="$arrNovel[og_novel_pin_yin]" /}' book.nextChapterVip = 0; book.uid = 0; diff --git a/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html b/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html index ca25862..e097826 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html +++ b/code/app/home/view/kuangyu/Novel/getNovelChapterAll.html @@ -7,7 +7,7 @@ + content='https://{$DomainModel->d_domain}{$strPcPath}/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrLatestChapter.c_sort_num ?? 1}' /> @@ -15,12 +15,12 @@ + content="https://{$DomainModel->d_domain}{$strPcPath}/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$intPage}"> + content="https://{$DomainModel->d_domain}{$strPcPath}/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrLatestChapter.c_sort_num ?? 1}"> diff --git a/code/app/home/view/kuangyu/Novel/getNovelInfo.html b/code/app/home/view/kuangyu/Novel/getNovelInfo.html index 33a5491..5f59c9b 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelInfo.html +++ b/code/app/home/view/kuangyu/Novel/getNovelInfo.html @@ -15,12 +15,12 @@ + content="https://{$DomainModel->d_domain}{$strPcPath}/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-1"> + content="https://{$DomainModel->d_domain}{$strPcPath}/xiaoshuo/{$arrNovel.og_novel_pin_yin}-{$arrNovel.n_id}/zhang-{$arrLatestChapter.c_sort_num ?? 1}"> diff --git a/code/app/home/view/kuangyu/Pc/Public/articleList.html b/code/app/home/view/kuangyu/Pc/Public/articleList.html index 99416cd..d2fe72b 100644 --- a/code/app/home/view/kuangyu/Pc/Public/articleList.html +++ b/code/app/home/view/kuangyu/Pc/Public/articleList.html @@ -1,10 +1,10 @@