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 @@
diff --git a/code/app/home/view/kuangyu/Pc/Public/hostListText.html b/code/app/home/view/kuangyu/Pc/Public/hostListText.html
index 331d925..92fe018 100644
--- a/code/app/home/view/kuangyu/Pc/Public/hostListText.html
+++ b/code/app/home/view/kuangyu/Pc/Public/hostListText.html
@@ -1,6 +1,6 @@
diff --git a/code/app/home/view/kuangyu/Pc/Public/indexBoyNewsOne.html b/code/app/home/view/kuangyu/Pc/Public/indexBoyNewsOne.html
index e4a6b98..0910555 100644
--- a/code/app/home/view/kuangyu/Pc/Public/indexBoyNewsOne.html
+++ b/code/app/home/view/kuangyu/Pc/Public/indexBoyNewsOne.html
@@ -1,9 +1,9 @@
diff --git a/code/app/home/view/kuangyu/Pc/Public/indexBoyRankList.html b/code/app/home/view/kuangyu/Pc/Public/indexBoyRankList.html
index 368a9dc..034dcea 100644
--- a/code/app/home/view/kuangyu/Pc/Public/indexBoyRankList.html
+++ b/code/app/home/view/kuangyu/Pc/Public/indexBoyRankList.html
@@ -2,12 +2,12 @@
{$key+=1}
diff --git a/code/app/home/view/kuangyu/Pc/Public/indexBoyRankOne.html b/code/app/home/view/kuangyu/Pc/Public/indexBoyRankOne.html
index e7a30e6..db5481e 100644
--- a/code/app/home/view/kuangyu/Pc/Public/indexBoyRankOne.html
+++ b/code/app/home/view/kuangyu/Pc/Public/indexBoyRankOne.html
@@ -2,10 +2,10 @@
1
diff --git a/code/app/home/view/kuangyu/Pc/Public/indexNewsUpdateList.html b/code/app/home/view/kuangyu/Pc/Public/indexNewsUpdateList.html
index 7ea1fe2..3d54687 100644
--- a/code/app/home/view/kuangyu/Pc/Public/indexNewsUpdateList.html
+++ b/code/app/home/view/kuangyu/Pc/Public/indexNewsUpdateList.html
@@ -5,12 +5,12 @@
- 作者:{$Novel->og_novel_author ?? ''} + 作者:{$Novel->og_novel_author ?? ''} 分类:{$Novel->og_novel_category ?? ''} 状态:{$Novel->og_novel_status ?? ''} @@ -16,12 +16,12 @@ 标签:
-最近更新:219 桃花酿 +
最近更新:219 桃花酿
{$Novel->og_description ?? ''}
diff --git a/code/app/home/view/kuangyu/Pc/User/index.html b/code/app/home/view/kuangyu/Pc/User/index.html
index e83e213..dfd506f 100644
--- a/code/app/home/view/kuangyu/Pc/User/index.html
+++ b/code/app/home/view/kuangyu/Pc/User/index.html
@@ -31,7 +31,7 @@
{$arrGRM[1]|raw}
- + ${book.og_novel_book_name} ${book.og_novel_status} - + ${book.og_novel_author} - + ${book.c_name} ${book.og_novel_update_time} - + 阅读
@@ -225,26 +225,26 @@ `; } else { bookElement.innerHTML = ` - +- + ${book.og_novel_book_name} ${book.og_novel_status} - + ${book.og_novel_author} - + ${book.c_name} ${book.og_novel_update_time} - + 阅读
diff --git a/code/app/home/view/kuangyu/Pc/getArticleInfo.html b/code/app/home/view/kuangyu/Pc/getArticleInfo.html index c73c5a9..2f067e4 100644 --- a/code/app/home/view/kuangyu/Pc/getArticleInfo.html +++ b/code/app/home/view/kuangyu/Pc/getArticleInfo.html @@ -23,7 +23,7 @@ {block name="logo-html"}