This commit is contained in:
make
2025-04-19 15:28:25 +08:00
parent 6b44e134c0
commit 6343c8d142
9 changed files with 154 additions and 116 deletions

View File

@@ -160,21 +160,37 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
switch ($key) {
case 'latest':
//最新章节
Route::get($strRoute, [Novel::class, 'getNovelLatestChapter'])
->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]);
$strView = 'pc/getNovelCatalog.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelCatalog.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]);
break;
case 'chapter':
//章节
Route::get($strRoute, [Novel::class, 'getNovelChapter'])
->pattern(['n_id' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']);
$strView = 'pc/getNovelChapter.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelChapter.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']);
break;
case 'kan-novel':
//伪造小说详情
Route::get($strRoute, [Novel::class, 'getKanNovelInfo'])
->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]);
$strView = 'pc/getNovelInfo.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelInfo.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]);
break;
case 'novel':
//小说详情
@@ -243,8 +259,15 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
break;
case 'search':
//搜素
Route::get($strRoute, [Novel::class, 'getSearchNovel'])->ext('html');
$strView = 'pc/getSearchNovel.html';
if ($platform == 'h5') {
$strView = 'novel/getSearchNovel.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})->ext('html');
break;
case 'user':
//用户中心
Route::get($strRoute, [User::class, 'Index']);