This commit is contained in:
make
2025-05-02 18:30:50 +08:00
parent 85f2ef5cb2
commit 65ac6d7652
19 changed files with 489 additions and 302 deletions

View File

@@ -83,36 +83,100 @@ $arrRoutes = [
// H5/PC 端前缀
'prefixes' => [
'pc' => ['/pc', '/web', '/desktop', '/index', '/shouye', '/zhuomian'],
'h5' => ['','/nindex'],
'h5' => ['', '/nindex'],
],
// 通用路径别名
'paths' => [
// 视频站点url -- start
/**
* 视频分类 分页
*
* /vodtype-dong-zuo-pian/dianying-zhongguodalu-guoyu-1992-news-page1
* /dong-zuo-pian/vodclass-dianying-zhongguodalu-guoyu-1992-news-page1
* /dong-zuo-pian-vodlist/dianying-zhongguodalu-guoyu-1992-news-page1
* /vodcategory-dianying/dong-zuo-pian/zhongguodalu-guoyu-1992-news-page1
*
* /video-type/dianying/dong-zuo-pian/zhongguodalu/guoyu/1992/news/page1
* /video-class-dianying/dong-zuo-pian/zhongguodalu-guoyu-1992-news-page1
* /video-list-dianying/dong-zuo-pian/zhongguodalu-guoyu-1992-news/page1
* /video-category-dianying/dong-zuo-pian/zhongguodalu-guoyu-1992-news-page1
*
* /shipinfenlei-dong-zuo-pian/dianying-zhongguodalu-guoyu-1992-news-page1
* /shipinleixing-dong-zuo-pian/dianying-zhongguodalu-guoyu-1992-news-page1
* /shipinliebiao-dong-zuo-pian/dianying-zhongguodalu-guoyu-1992-news-page1
*
* /vodshow/电影/动作片/中国大陆/国语/1992/最新/第一页
*/
'video_category' => [
'/vodtype-:strCategory/:strClass-:strArea-:strLang-:strYear-:strSort-page:intPage',
'/:strCategory/vodclass-:strClass-:strArea-:strLang-:strYear-:strSort-page:intPage',
'/vodcategory-:strClass/:strCategory/:strArea-:strLang-:strYear-:strSort-page:intPage',
'/:strCategory-vodlist/:strClass-:strArea-:strLang-:strYear-:strSort-page:intPage',
'/video-type/:strClass/:strCategory/:strArea/:strLang/:strYear/:strSort/page:intPage',
'/video-class-:strClass/:strCategory/:strArea-:strLang-:strYear-:strSort-page:intPage',
'/video-category-:strClass/:strCategory/:strArea-:strLang-:strYear-:strSort-page:intPage',
'/video-list-:strClass/:strCategory/:strArea-:strLang-:strYear-:strSort/page:intPage',
'/shipinfenlei-:strCategory/:strClass-:strArea-:strLang-:strYear-:strSort-page:intPage',
'/shipinleixing-:strCategory/:strClass-:strArea-:strLang-:strYear-:strSort-page:intPage',
'/shipinliebiao-:strCategory/:strClass-:strArea-:strLang-:strYear-:strSort-page:intPage',
],
// 视频分类 首页
'video_category_index' => [
'/vodtype/:strCategory',
'/vodclass/:strCategory',
'/shipin-fenlei/:strCategory',
'/shipin-leixing/:strCategory',
'/vodcategory/:strCategory',
'/vodlist/:strCategory',
'/video-type/:strCategory',
'/video-class/:strCategory',
'/video-category/:strCategory',
'/video-leixing/:strCategory',
'/video-list/:strCategory',
'/shipinfenlei/:strCategory',
'/shipinleixing/:strCategory',
'/shipinliebiao/:strCategory',
],
// 视频分类 分页 /vodshow/dianying/dong-zuo-pian/中国大陆/国语/1992/news/page1
// /vodshow/电影/动作片/中国大陆/国语/1992/最新/第一页
// /vodshow/dianying/dong-zuo-pian/zhongguodalu/guoyu/1992/news/page1
'video_category' => [
'/vodshow/:strClass/:strCategory/:strArea/:strLang/:strYear/:strSort/page:intPage',
'/:strCategory/vodshow-:strClass-:strArea-:strLang-:strYear-:strSort-page:intPage',
'/vodshow-:strCategory/:strClass-:strArea-:strLang-:strYear-:strSort-page:intPage',
// '/vodshow/:strClass-:strCategory-:strArea-:strLang-:strYear-:strSort-page:intPage',
// /dong-zuo-pian/vodshow-dianying-zhongguodalu-guoyu-1992-news-page1
// /vodshow-dong-zuo-pian/dianying-zhongguodalu-guoyu-1992-news-page1
// /vodshow/dianying-dong-zuo-pian-zhongguodalu-guoyu-1992-news-page1
/**
* 视频详情
* /voddetail/strVideoPinyin-1
*/
'video_info' => [
'/voddetail/:strVideoPinyin-:intVideoId',
'/vodinfo/:strVideoPinyin-:intVideoId',
'/vod/:strVideoPinyin-:intVideoId',
'/video-info/:strVideoPinyin-:intVideoId',
'/video-detail/:strVideoPinyin-:intVideoId',
'/video/:strVideoPinyin-:intVideoId',
'/shipin/:strVideoPinyin-:intVideoId',
'/shipin-xiangqing/:strVideoPinyin-:intVideoId',
'/shipin-neiron/:strVideoPinyin-:intVideoId',
],
// 视频播放 /vodplay/strVideoPinyin-10-wuxian-1
'video_play' => [
'/vodplay/:strVideoPinyin-:intVideoId-:strPlayType-:intPlayIndex',
'/vodbf/:strVideoPinyin-:intVideoId-:strPlayType-:intPlayIndex',
'/vodseed/:strVideoPinyin-:intVideoId-:strPlayType-:intPlayIndex',
'/video-play/:strVideoPinyin-:intVideoId-:strPlayType-:intPlayIndex',
'/video-bofang/:strVideoPinyin-:intVideoId-:strPlayType-:intPlayIndex',
'/video-show/:strVideoPinyin-:intVideoId-:strPlayType-:intPlayIndex',
'/shipin-play/:strVideoPinyin-:intVideoId-:strPlayType-:intPlayIndex',
'/shipin-bofang/:strVideoPinyin-:intVideoId-:strPlayType-:intPlayIndex',
'/shipin-kan/:strVideoPinyin-:intVideoId-:strPlayType-:intPlayIndex',
],
@@ -223,7 +287,7 @@ $arrRoutes = [
// '/fenlei/:strCategory/:strOrder/page:intPage',
// '/class/:strCategory/:strOrder/page:intPage',
// '/category/:strCategory/:strOrder/page:intPage',
/**
* default 模板 /shuku/xuanhuan-xiuzhen/page1
@@ -328,39 +392,61 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/getCategoryType.html';
if ($platform == 'h5') {
$strView = 'video/getCategoryType.html';
}
}
//视频分类 首页
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern([
'strCategory' => '[a-z\-]*', // 允许空值
]);
->pattern([
'strCategory' => '[a-z\-]*', // 允许空值
]);
break;
case 'video_category':
$strView = 'pc/getCategory.html';
if ($platform == 'h5') {
$strView = 'video/getCategory.html';
}
}
//视频分类 分页
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern([
'strClass' => '[a-z\-]*', // 允许空值
'strCategory' => '[a-z\-]*', // 允许空值
'strArea' => '[a-z\-]*', // 允许空值
'strLang' => '[a-z\-]*', // 允许空值
'strYear' => '[a-zA-Z0-9\-]*', // 允许空值
'strSort' => '[a-z\-]*', // 允许空值
'intPage' => '\d*', // 允许空值
// '/vodshow/:strClass/:strCategory/:strArea/:strLang/:strYear/:strSort/page:intPage'
// /vodshow/dianying/dong-zuo-pian/zhongguodalu/guoyu/1992/news/page1
// /dong-zuo-pian/vodshow-dianying-zhongguodalu-guoyu-1992-news-page1
]);
->pattern([
'strClass' => '[a-z\-]*', // 允许空值
'strCategory' => '[a-z\-]*', // 允许空值
'strArea' => '[a-z\-]*', // 允许空值
'strLang' => '[a-z\-]*', // 允许空值
'strYear' => '[a-zA-Z0-9\-]*', // 允许空值
'strSort' => '[a-z\-]*', // 允许空值
'intPage' => '\d*', // 允许空值
]);
break;
case 'video_info':
//详情
$strView = 'pc/getVideoInfo.html';
if ($platform == 'h5') {
$strView = 'video/getVideoInfo.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern(['intVideoId' => '\d+', 'strVideoPinyin' => '[\w-]+',]);
break;
case 'video_play':
//播放
$strView = 'pc/getVideoPlayUrl.html';
if ($platform == 'h5') {
$strView = 'video/getVideoPlayUrl.html';
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern(['intVideoId' => '\d+', 'intPlayIndex' => '\d+', 'strPlayType' => '[\w-]+','strVideoPinyin' => '[\w-]+',]);
break;
// 视频站点url -- end
case 'latest':
@@ -368,11 +454,11 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$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-]+',]);
->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+',]);
break;
case 'chapter':
@@ -380,11 +466,11 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$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+']);
->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']);
break;
case 'kan-novel':
@@ -392,11 +478,11 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/getNovelInfo.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelInfo.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern(['intNovelId' => '\d+', 'intForgeId' => '\d+', 'name' => '[\w-]+',]);
->pattern(['intNovelId' => '\d+', 'intForgeId' => '\d+', 'name' => '[\w-]+',]);
break;
case 'novel':
@@ -404,43 +490,43 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/getNovelInfo.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelInfo.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+',]);
->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+',]);
break;
case 'catalog':
//目录
$strView = 'pc/getNovelCatalog.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelCatalog.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']);
->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']);
break;
case 'library':
$strView = 'pc/getLibrary.html';
if ($platform == 'h5') {
$strView = 'novel/getLibrary.html';
}
}
//书库/分类
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern([
'strGender' => '[a-z\-]*', // 允许空值
'strCategory' => '[a-z\-]*', // 允许空值
'strStatus' => '(all|lianzai|wanjie)?', // 允许空值
'strOrder' => '[a-z\-]*', // 允许空值
'intPage' => '\d*', // 允许空值
// 'strCategory' => 'all|xuanhuan-xiuzhen|junshi-xiaoshuo|wangyou-xiaoshuo|kehuan-xiaoshuo|hongsheng-chuanyue|dushi-xiaoshuo|lingyi-xiaoshuo|yanqing-xiaoshuo|qita-xiaoshuo',
->pattern([
'strGender' => '[a-z\-]*', // 允许空值
'strCategory' => '[a-z\-]*', // 允许空值
'strStatus' => '(all|lianzai|wanjie)?', // 允许空值
'strOrder' => '[a-z\-]*', // 允许空值
'intPage' => '\d*', // 允许空值
// 'strCategory' => 'all|xuanhuan-xiuzhen|junshi-xiaoshuo|wangyou-xiaoshuo|kehuan-xiaoshuo|hongsheng-chuanyue|dushi-xiaoshuo|lingyi-xiaoshuo|yanqing-xiaoshuo|qita-xiaoshuo',
]);
]);
break;
case 'library-index':
@@ -448,18 +534,18 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/getLibrary.html';
if ($platform == 'h5') {
$strView = 'novel/getLibrary.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
});
break;
case 'rank':
//排行榜
$strView = 'pc/getNovelRank.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelRank.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
});
@@ -469,7 +555,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/getNovelRank.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelRank.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})->pattern([
@@ -481,13 +567,13 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
]);
break;
case 'boys':
//男生
$strView = 'pc/getNovelChannel.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelChannel.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})->append(['strChannel' => 'man']);
@@ -500,7 +586,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/getNovelChannel.html';
if ($platform == 'h5') {
$strView = 'novel/getNovelChannel.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})->append(['strChannel' => 'women']);
@@ -513,7 +599,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/getSearchNovel.html';
if ($platform == 'h5') {
$strView = 'novel/getSearchNovel.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
})->ext('html');
@@ -524,7 +610,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/user/index.html';
if ($platform == 'h5') {
$strView = 'user/index.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
});
@@ -535,7 +621,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/user/getBookShelf.html';
if ($platform == 'h5') {
$strView = 'user/getBookShelf.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
});
@@ -546,7 +632,7 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/user/getHistory.html';
if ($platform == 'h5') {
$strView = 'user/getHistory.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
});
@@ -555,11 +641,11 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
case 'index':
// 首页
if ($platform == 'h5') {
Route::get($strRoute, function (\think\Request $Request, SiteContext $SiteContext ) {
Route::get($strRoute, function (\think\Request $Request, SiteContext $SiteContext) {
return view($SiteContext->getHomeView('h5'));
});
} else {
Route::get($strRoute, function (\think\Request $Request, SiteContext $SiteContext ) {
Route::get($strRoute, function (\think\Request $Request, SiteContext $SiteContext) {
return view($SiteContext->getHomeView('pc'));
});
}
@@ -569,12 +655,11 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
$strView = 'pc/index.html';
if ($platform == 'h5') {
$strView = 'index/index.html';
}
}
Route::get($strRoute, function () use ($strView) {
return view($strView);
});
break;
}
}
}