This commit is contained in:
make
2025-04-19 16:51:13 +08:00
parent 6343c8d142
commit 069a80889f
2 changed files with 57 additions and 9 deletions

View File

@@ -169,6 +169,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
})
->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]);
break;
case 'chapter':
//章节
$strView = 'pc/getNovelChapter.html';
@@ -192,6 +193,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
})
->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]);
break;
case 'novel':
//小说详情
$strView = 'pc/getNovelInfo.html';
@@ -247,16 +249,41 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
break;
case 'rank':
//排行榜
Route::get($strRoute, [Novel::class, 'getNovelRank']);
$strView = 'pc/getNovelRank.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelRank.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
});
break;
case 'boys':
//男生
Route::get($strRoute, [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => $boolIsMobile, 'strChannel' => 'boys']);
$strView = 'pc/getNovelChannel.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelChannel.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})->append(['strChannel' => 'boys']);
//Route::get($strRoute, [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => $boolIsMobile, 'strChannel' => 'boys']);
break;
case 'girls':
//女生
Route::get($strRoute, [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => $boolIsMobile, 'strChannel' => 'girls']);
$strView = 'pc/getNovelChannel.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelChannel.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})->append(['strChannel' => 'girls']);
//Route::get($strRoute, [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => $boolIsMobile, 'strChannel' => 'girls']);
break;
case 'search':
//搜素
$strView = 'pc/getSearchNovel.html';
@@ -267,19 +294,40 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
return view($strView);
})->ext('html');
break;
case 'user':
//用户中心
Route::get($strRoute, [User::class, 'Index']);
$strView = 'pc/user/index.html';
if ($platform == 'h5') {
$strView = 'user/index.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
});
break;
case 'bookshelf':
//书架
Route::get($strRoute, [User::class, 'getBookShelf']);
$strView = 'pc/user/getBookShelf.html';
if ($platform == 'h5') {
$strView = 'user/getBookShelf.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
});
break;
case 'history':
//历史记录
Route::get($strRoute, [User::class, 'getHistory']);
$strView = 'pc/user/getHistory.html';
if ($platform == 'h5') {
$strView = 'user/getHistory.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
});
break;
case 'index':
// 首页
if ($platform == 'h5') {