This commit is contained in:
Default
2025-04-18 16:19:54 +08:00
parent 3e4ec4b1cb
commit cf9ad1f065
4 changed files with 37 additions and 8 deletions

View File

@@ -5,16 +5,16 @@ declare(strict_types=1);
use app\home\controller\Index;
use app\home\controller\Novel;
use app\home\controller\User;
use app\services\SiteContext;
use think\facade\Route;
Route::get('/article/fenlei/:category', function (\think\Request $Request) {
return view('test/test01/index.html');
Route::get('/article/fenlei/:category', function (\think\Request $Request, SiteContext $SiteContext) {
return view($SiteContext->getHomeView());
});
/**
* 路由配置文件
*/

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
{novel:info n_id="$DomainModel->n_id" n_key="arrNovel01" n_forge_id="1125940" /}
<title>{$arrNovel01.n_name} - 首页</title>
</head>
<body>
{$arrNovel01.n_description}
</body>
</html>

View File

@@ -1,5 +1,5 @@
{site:grm page_code="fdasfadsf" diff="fadsfdsa" num="10" g_key="arrGrm" /}
{php}var_dump($arrGrm);{/php}
<!-- {site:grm page_code="fdasfadsf" diff="fadsfdsa" num="10" g_key="arrGrm" /}
{php}var_dump($arrGrm);{/php} -->
<!-- {chapter:info n_id="1" c_sort_num="200" c_page="0" c_key="arrChapter01" /}
{$arrChapter01.c_name} -->
@@ -50,8 +50,8 @@
<!-- {novel:info n_id="33" n_key="arrNovel01" n_forge_id="1125940" /}
{$arrNovel01.n_name} -->
{novel:info n_id="33" n_key="arrNovel01" n_forge_id="1125940" /}
{$arrNovel01.n_name}
<!-- {$DomainModel->d_domain} -->

View File

@@ -125,4 +125,19 @@ class SiteContext
return GanRaoMaModel::getGrmCode($strDomain, $strPageCode, $strDiff, $intNum);
}
/**
* get home view
*
* @return string
*/
public function getHomeView(): string
{
if ($this->DomainModel->n_id > 0) {
$strView = 'test/test01/faker.html';
} else {
$strView = 'test/test01/index.html';
}
return $strView;
}
}