diff --git a/code/app/home/config/router.php b/code/app/home/config/router.php index 6220eb6..2ef7f54 100644 --- a/code/app/home/config/router.php +++ b/code/app/home/config/router.php @@ -7,899 +7,197 @@ use app\home\controller\Novel; use app\home\controller\User; use think\facade\Route; -// 加载路由配置文件(从 config 目录) -$arrRoutes = include config_path('routes.php'); - -/** - * 首页 - h5 - */ -Route::get("/", [Index::class, 'index'])->ext('html')->append(['boolIsMobile' => true]); - -/** - * 首页 - pc - */ -Route::get("/pc/", [Index::class, 'getPcIndex'])->append(['boolIsMobile' => false]); -Route::get("/web/", [Index::class, 'getPcIndex'])->append(['boolIsMobile' => false]); -Route::get("/desktop/", [Index::class, 'getPcIndex'])->append(['boolIsMobile' => false]); -Route::get("/index/", [Index::class, 'getPcIndex'])->append(['boolIsMobile' => false]); -Route::get("/shouye/", [Index::class, 'getPcIndex'])->append(['boolIsMobile' => false]); - -/** - * 排行榜 - h5 - */ -Route::get('/paihang/all', [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => true]); -Route::get('/rank/all', [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => true]); -Route::get('/paihang-quan', [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => true]); -Route::get('/top/all', [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => true]); -Route::get('/paihang-bang', [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => true]); -Route::get('/ranks/all', [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => true]); - -/** - * 排行榜 - pc - */ -Route::get("/pc/paihang/all", [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => false]); -Route::get("/pc/rank/all", [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => false]); -Route::get("/pc/paihang-quan", [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => false]); -Route::get("/pc/top/all", [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => false]); -Route::get("/pc/paihang-bang", [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => false]); -Route::get("/pc/ranks/all", [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => false]); - -/** - * 男生 - h5 - */ -Route::get('/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']); -Route::get('/boys-novel', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']); -Route::get('/nansheng-shu', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']); -Route::get('/man-read', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']); -Route::get('/nansheng-book', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']); -Route::get('/male-novels', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']); - -/** - * 男生 - pc - */ -Route::get('/pc/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']); -Route::get('/pc/boys-novel', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']); -Route::get('/pc/nansheng-shu', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']); -Route::get('/pc/man-read', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']); -Route::get('/pc/nansheng-book', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']); -Route::get('/pc/male-novels', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']); - -/** - * 女生 - h5 - */ -Route::get('/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'girls']); -Route::get('/girls-novel', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'girls']); -Route::get('/nvsheng-shu', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'girls']); -Route::get('/woman-read', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'girls']); -Route::get('/nvsheng-book', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'girls']); -Route::get('/female-novels', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'girls']); - -/** - * 女生 - pc - */ -Route::get('/pc/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); -Route::get('/pc/girls-novel', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); -Route::get('/pc/nvsheng-shu', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); -Route::get('/pc/woman-read', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); -Route::get('/pc/nvsheng-book', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); -Route::get('/pc/female-novels', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); - -/** - * 书库 h5 - */ -Route::get('/shuku/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => true]); -Route::get('/books/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => true]); -Route::get('/library/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => true]); -Route::get('/fenlei/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => true]); -Route::get('/class/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => true]); -Route::get('/category/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => true]); - -/** - * 书库 - pc - */ -Route::get('/pc/shuku/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => false]); -Route::get('/pc/books/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => false]); -Route::get('/pc/library/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => false]); -Route::get('/pc/fenlei/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => false]); -Route::get('/pc/class/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => false]); -Route::get('/pc/category/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => false]); - -/** - * 书库首页-h5 - */ -Route::get('/shuku/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => true]); -Route::get('/books/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => true]); -Route::get('/library/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => true]); -Route::get('/fenlei/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => true]); -Route::get('/class/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => true]); -Route::get('/category/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => true]); - -/** - * 书库首页-pc - */ -Route::get('/pc/shuku/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => false]); -Route::get('/pc/books/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => false]); -Route::get('/pc/library/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => false]); -Route::get('/pc/fenlei/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => false]); -Route::get('/pc/class/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => false]); -Route::get('/pc/category/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => false]); - -/** - * 小说章节 - h5 - * /xiaoshuo/小说拼音-小说id/zhang-章节排序/章节分页 - * /xiaoshuo/小说拼音-小说id/di-章节排序-zhang/章节分页 - */ -Route::get('/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); -Route::get('/novel/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); -Route::get('/book/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); -Route::get('/xiaoshuo-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); -Route::get('/novel-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); -Route::get('/book-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); - -/** - * 小说章节 - pc - */ -Route::get('/pc/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); -Route::get('/pc/novel/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); -Route::get('/pc/book/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); -Route::get('/pc/xiaoshuo-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); -Route::get('/pc/novel-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); -Route::get('/pc/book-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); - -/** - * 最新章节-特殊页面处理-pc - */ -Route::get('/pc/xiaoshuo/:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/novel/:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/book/:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/xiaoshuo-:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/novel-:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/book-:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); - -/** - * 最新章节-特殊页面处理-h5 - */ -Route::get('/xiaoshuo/:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/novel/:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/book/:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/xiaoshuo-:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/novel-:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/book-:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); - -/** - * 小说目录页面-h5 - * /xiaoshuo/[小说拼音]-[小说id]/mulu/order/[page] - */ -Route::get('/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); -Route::get('/novel/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); -Route::get('/book/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); -Route::get('/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); -Route::get('/novel/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); -Route::get('/book/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); - -/** - * 小说目录页面-pc - */ -Route::get('/pc/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); -Route::get('/pc/novel/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); -Route::get('/pc/book/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); -Route::get('/pc/xiaoshuo-:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); -Route::get('/pc/novel-:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); -Route::get('/pc/book-:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); - -/** - * 伪小说详情-pc - */ -Route::get('/pc/kan-xiaoshuo/:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/kan-novel/:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/kan-book/:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/kan-xiaoshuo-:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/kan-novel-:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/kan-book-:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); - -/** - * 伪小说详情-h5 - */ -Route::get('/kan-xiaoshuo/:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/kan-novel/:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/kan-book/:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/kan-xiaoshuo-:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/kan-novel-:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/kan-book-:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); - - -/** - * 小说详情-pc - * /xiaoshuo/{strPinYin}-{intNId} - * /novel/{strPinYin}-{intNId} - * /book/{strPinYin}-{intNId} - * /xiaoshuo-{strPinYin}-{intNId} - * /novel-{strPinYin}-{intNId} - * /book-{strPinYin}-{intNId} - */ -Route::get('/pc/xiaoshuo/:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/novel/:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/book/:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/xiaoshuo-:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 3]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/novel-:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 3]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/pc/book-:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 3]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); - -/** - * 小说详情-h5 - */ -Route::get('/xiaoshuo/:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/novel/:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/book/:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/xiaoshuo-:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 3]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/novel-:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 3]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); -Route::get('/book-:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 3]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); - -/** - * 搜索小说 - h5 - */ -Route::get('/search', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]); -Route::get('/explore', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]); -Route::get('/sousuo', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]); -Route::get('/find', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]); -Route::get('/query', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]); -Route::get('/keywords', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]); - -/** - * 搜索小说 - pc - */ -Route::get('/pc/search', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]); -Route::get('/pc/explore', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]); -Route::get('/pc/sousuo', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]); -Route::get('/pc/find', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]); -Route::get('/pc/query', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]); -Route::get('/pc/keywords', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]); - -/** - * 小说用户中心 - h5 - */ -Route::get('/user', [User::class, 'Index'])->append(['boolIsMobile' => true]); -Route::get('/my-account', [User::class, 'Index'])->append(['boolIsMobile' => true]); -Route::get('/profile', [User::class, 'Index'])->append(['boolIsMobile' => true]); -Route::get('/yonghu', [User::class, 'Index'])->append(['boolIsMobile' => true]); -Route::get('/wode-zhongxin', [User::class, 'Index'])->append(['boolIsMobile' => true]); -Route::get('/personal-center', [User::class, 'Index'])->append(['boolIsMobile' => true]); - -/** - * 小说用户中心 - pc - */ -Route::get('/pc/user', [User::class, 'Index'])->append(['boolIsMobile' => false]); -Route::get('/pc/my-account', [User::class, 'Index'])->append(['boolIsMobile' => false]); -Route::get('/pc/profile', [User::class, 'Index'])->append(['boolIsMobile' => false]); -Route::get('/pc/yonghu', [User::class, 'Index'])->append(['boolIsMobile' => false]); -Route::get('/pc/wode-zhongxin', [User::class, 'Index'])->append(['boolIsMobile' => false]); -Route::get('/pc/personal-center', [User::class, 'Index'])->append(['boolIsMobile' => false]); - - -/** - * 书架 - h5 - */ -Route::get('/bookshelf', [User::class, 'getBookShelf'])->append(['boolIsMobile' => true]); -Route::get('/book-shelf', [User::class, 'getBookShelf'])->append(['boolIsMobile' => true]); -Route::get('/reading-shelf', [User::class, 'getBookShelf'])->append(['boolIsMobile' => true]); -Route::get('/shujia', [User::class, 'getBookShelf'])->append(['boolIsMobile' => true]); -Route::get('/yuedu-shujia', [User::class, 'getBookShelf'])->append(['boolIsMobile' => true]); -Route::get('/book-collection', [User::class, 'getBookShelf'])->append(['boolIsMobile' => true]); - -/** - * 书架 - pc - */ -Route::get('/pc/bookshelf', [User::class, 'getBookShelf'])->append(['boolIsMobile' => false]); -Route::get('/pc/book-shelf', [User::class, 'getBookShelf'])->append(['boolIsMobile' => false]); -Route::get('/pc/reading-shelf', [User::class, 'getBookShelf'])->append(['boolIsMobile' => false]); -Route::get('/pc/shujia', [User::class, 'getBookShelf'])->append(['boolIsMobile' => false]); -Route::get('/pc/yuedu-shujia', [User::class, 'getBookShelf'])->append(['boolIsMobile' => false]); -Route::get('/pc/book-collection', [User::class, 'getBookShelf'])->append(['boolIsMobile' => false]); - -/** - * 历史记录 - h5 -*/ -Route::get('/history', [User::class, 'getHistory'])->append(['boolIsMobile' => true]); -Route::get('/reading-history', [User::class, 'getHistory'])->append(['boolIsMobile' => true]); -Route::get('/read-record', [User::class, 'getHistory'])->append(['boolIsMobile' => true]); -Route::get('/lishi', [User::class, 'getHistory'])->append(['boolIsMobile' => true]); -Route::get('/yuedu-lishi', [User::class, 'getHistory'])->append(['boolIsMobile' => true]); -Route::get('/browse-past', [User::class, 'getHistory'])->append(['boolIsMobile' => true]); - -/** - * 历史记录 - pc - */ -Route::get('/pc/history', [User::class, 'getHistory'])->append(['boolIsMobile' => false]); -Route::get('/pc/reading-history', [User::class, 'getHistory'])->append(['boolIsMobile' => false]); -Route::get('/pc/read-record', [User::class, 'getHistory'])->append(['boolIsMobile' => false]); -Route::get('/pc/lishi', [User::class, 'getHistory'])->append(['boolIsMobile' => false]); -Route::get('/pc/yuedu-lishi', [User::class, 'getHistory'])->append(['boolIsMobile' => false]); -Route::get('/pc/browse-past', [User::class, 'getHistory'])->append(['boolIsMobile' => false]); - - -// 文章 列表 -// Route::get('/article/list-[:intCategoryId]-[:intPage]', [Novel::class, 'getArticleList'])->append(['boolIsMobile' => true]); -// Route::get('/pc/article/list-[:intCategoryId]-[:intPage]', [Novel::class, 'getArticleList'])->append(['boolIsMobile' => false]); -// Route::get('/article/list', [Novel::class, 'getArticleList'])->append(['boolIsMobile' => true]); -// Route::get('/pc/article/list', [Novel::class, 'getArticleList'])->append(['boolIsMobile' => false]); - -// // 文章 详情 -// Route::get('/article/info-:intArticleId', [Novel::class, 'getArticleInfo'])->append(['boolIsMobile' => true]); -// Route::get('/pc/article/info-:intArticleId', [Novel::class, 'getArticleInfo'])->append(['boolIsMobile' => false]); - - - - - -//分类 - 其它模板 -// Route::get('class', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => true]); -// Route::get('/pc/class', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => false]); -// // //分类 使用模板:xmttxs -// // Route::get('/books', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => true]); -// // Route::get('/pc/books', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => false]); -// // Route::get('/books/[:intCategoryId]-[:intPage]', 'Novel/getNovelCategory')->ext('html')->append(['boolIsMobile' => true]); -// Route::get('/pc/fenlei/append(['boolIsMobile' => false]) -// ->pattern(['intCategoryId' => '\d+','intPage' => '\d+',]) -// ->ext('html'); - - - - - - -/** - * 首页 - h5 - */ -Route::get("/", [Index::class, 'index'])->ext('html')->append(['boolIsMobile' => true]); - -/** - * 首页 - pc - */ -Route::get("/pc/", [Index::class, 'getPcIndex'])->append(['boolIsMobile' => false]); - -/** - * 排行榜 - h5 - */ -Route::get('/paihang/all', [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => true]); - -/** - * 排行榜 - pc - */ -Route::get("/pc/paihang/all", [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => false]); - -/** - * 男生 - h5 - */ -Route::get('/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'boys']); - -/** - * 男生 - pc - */ -Route::get('/pc/nansheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'boys']); - -/** - * 女生 - h5 - */ -Route::get('/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => true, 'strChannel' => 'girls']); - -/** - * 女生 - pc - */ -Route::get('/pc/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append(['boolIsMobile' => false, 'strChannel' => 'girls']); - -/** - * 书库 h5 - */ -Route::get('/shuku/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => true]); - - -/** - * 书库 - pc - */ -Route::get('/pc/shuku/:strGender/:strCategory/:strStatus/page:intPage', [Novel::class, 'getLibrary']) - ->pattern([ - 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', - 'strCategory' => '[a-z\-]+', - 'strStatus' => 'all|lianzai|wanjie', - 'intPage' => '\d+' - ]) - ->append(['boolIsMobile' => false]); - - - -/** - * 书库首页-h5 - */ -Route::get('/shuku/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => true]); - - -/** - * 书库首页-pc - */ -Route::get('/pc/shuku/all', [Novel::class, 'getLibrary'])->append(['boolIsMobile' => false]); - -/** - * 小说章节 - h5 - * /xiaoshuo/小说拼音-小说id/zhang-章节排序/章节分页 - * /xiaoshuo/小说拼音-小说id/di-章节排序-zhang/章节分页 - */ -Route::get('/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); - -/** - * 小说章节 - pc - */ -Route::get('/pc/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', [Novel::class, 'getNovelChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); - - -/** - * 最新章节-特殊页面处理-pc - */ -Route::get('/pc/xiaoshuo/:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); - - -/** - * 最新章节-特殊页面处理-h5 - */ -Route::get('/xiaoshuo/:name-:n_id/chapter/latest', [Novel::class, 'getNovelLatestChapter']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); - - -/** - * 小说目录页面-h5 - * /xiaoshuo/[小说拼音]-[小说id]/mulu/order/[page] - */ -Route::get('/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => true, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); - - -/** - * 小说目录页面-pc - */ -Route::get('/pc/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::class, 'getNovelChapterAll']) - ->append(['boolIsMobile' => false, 'intUriType' => 1]) - ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); - - -/** - * 伪小说详情-pc - */ -Route::get('/pc/kan-xiaoshuo/:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); - -/** - * 伪小说详情-h5 - */ -Route::get('/kan-xiaoshuo/:name-:n_id-:n_forge_id', [Novel::class, 'getKanNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); - -/** - * 小说详情-pc - */ -Route::get('/pc/xiaoshuo/:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => false, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); - -/** - * 小说详情-h5 - */ -Route::get('/xiaoshuo/:name-:n_id', [Novel::class, 'getNovelInfo']) - ->append(['boolIsMobile' => true, 'intUriType' => 2]) - ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); - -/** - * 搜索小说 - h5 - */ -Route::get('/search', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]); - -/** - * 搜索小说 - pc - */ -Route::get('/pc/search', [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]); - -/** - * 小说用户中心 - h5 - */ -Route::get('/user', [User::class, 'Index'])->append(['boolIsMobile' => true]); - -/** - * 小说用户中心 - pc - */ -Route::get('/pc/user', [User::class, 'Index'])->append(['boolIsMobile' => false]); - - -/** - * 书架 - h5 - */ -Route::get('/bookshelf', [User::class, 'getBookShelf'])->append(['boolIsMobile' => true]); - -/** - * 书架 - pc - */ -Route::get('/pc/bookshelf', [User::class, 'getBookShelf'])->append(['boolIsMobile' => false]); - -/** - * 历史记录 - h5 -*/ -Route::get('/history', [User::class, 'getHistory'])->append(['boolIsMobile' => true]); - - -/** - * 历史记录 - pc - */ -Route::get('/pc/history', [User::class, 'getHistory'])->append(['boolIsMobile' => false]); - - - - - - - - - - - - -// if(config('app.default_index_info_isopen')){ -// # SEO首页-此为了 那些那详情页做首页推广的站点 -// Route::get("/", "Novel/getDetail")->name("Novel@getDetail")->cache('/index.html', 600, 'index'); - -// // 影视首页 -// Route::get("/nindex", "Novel/Index")->name("Novel@Index")->cache('/nindex.html', 600, 'nindex'); -// }else{ -// Route::get("/", "Novel/Index")->name("Novel@Index")->cache('/index.html', 600, 'index'); -// } - - - -// # 定义所有分类路由 -// $arrRoutes = [ -// # 小说推荐 -// [ -// 'class'=>[Novel::class,'getRankList'], -// 'name'=>'Novel@getTuijianList', -// 'path'=>[ -// [::class,'tj/:intTjdj-[:intPage]'], -// [::class,'tuijian/:intTjdj-[:intPage]'], -// [::class,'recommend/:intTjdj-[:intPage]'], -// [::class,'nice/:intTjdj-[:intPage]'], -// [::class,'good/:intTjdj-[:intPage]'], -// [::class,'推荐/:intTjdj-[:intPage]'], -// ], -// ], -// # 小说分类 -// [ -// 'class'=>[Novel::class,'getCategoryList'], -// 'name'=>'Novel@getCategoryList', -// 'path'=>[ -// [::class,'list/:intCId-:intSort-:intStatus-[:intPage]'], -// [::class,'fenlei/:intCId-:intSort-:intStatus-[:intPage]'], -// [::class,'class/:intCId-:intSort-:intStatus-[:intPage]'], -// [::class,'type/:intCId-:intSort-:intStatus-[:intPage]'], -// [::class,'leixin/:intCId-:intSort-:intStatus-[:intPage]'], -// [::class,'小说分类/:intCId-:intSort-:intStatus-[:intPage]'], -// ], -// ], -// # 小说排行 -// [ -// 'class'=>[Novel::class,'getNovelRankList'], -// 'name'=>'Novel@getNovelRankList', -// 'path'=>[ -// [::class,'paihang/:intCId-:intSort-[:intPage]'], -// [::class,'paihanbang/:intCId-:intSort-[:intPage]'], -// [::class,'rank/:intCId-:intSort-[:intPage]'], -// [::class,'sort/:intCId-:intSort-[:intPage]'], -// [::class,'pb/:intCId-:intSort-[:intPage]'], -// [::class,'排行榜/:intCId-:intSort-[:intPage]'], -// ], -// ], - -// # 小说章节 -// [ -// 'class'=>[Novel::class,'getReader'], -// 'name'=>'Novel@getReader', -// 'path'=>[ -// [::class,'xq/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// [::class,'xiaoshuo/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// [::class,'novel/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// [::class,'info/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// [::class,'shu/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// [::class,'小说/:intNovelId/:intZhangJiePaiXu-[:strSort]'], - -// [::class,'book/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// [::class,'kan/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// [::class,'show/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// [::class,'yuedu/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// [::class,'see/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// [::class,'相关/:intNovelId/:intZhangJiePaiXu-[:strSort]'], -// ], -// ], - -// # 小说详情 -// [ -// 'class'=>[Novel::class,'getDetail'], -// 'name'=>'Novel@getDetail', -// 'path'=>[ -// [::class,'xq/:intNovelId-[:intCurrentPage]-[:strSort]'], -// [::class,'xiaoshuo/:intNovelId-[:intCurrentPage]-[:strSort]'], -// [::class,'novel/:intNovelId-[:intCurrentPage]-[:strSort]'], -// [::class,'info/:intNovelId-[:intCurrentPage]-[:strSort]'], -// [::class,'shu/:intNovelId-[:intCurrentPage]-[:strSort]'], -// [::class,'小说/:intNovelId-[:intCurrentPage]-[:strSort]'], - -// [::class,'book/:intNovelId-[:intCurrentPage]-[:strSort]'], -// [::class,'kan/:intNovelId-[:intCurrentPage]-[:strSort]'], -// [::class,'show/:intNovelId-[:intCurrentPage]-[:strSort]'], -// [::class,'yuedu/:intNovelId-[:intCurrentPage]-[:strSort]'], -// [::class,'see/:intNovelId-[:intCurrentPage]-[:strSort]'], -// [::class,'相关/:intNovelId-[:intCurrentPage]-[:strSort]'], -// ], -// ], -// # 搜索 - 小说 -// [ -// [class'=>'Search::class,'getNovel'], -// 'name'=>'Search@getNovel', -// 'path'=>[ -// [::class,'search'], -// ], -// ], -// # 书架 -// [ -// [class'=>'Search::class,'getShujia'], -// [name'=>'Search::class,'getShujia'], -// 'path'=>[ -// [::class,'shujia'], -// ], -// ], -// # 收藏 -// [ -// [class'=>'Search::class,'addSc'], -// [name'=>'Search::class,'addSc'], -// 'path'=>[ -// [::class,'sc'], -// ], -// ], -// ]; - -// // Route::get('/sc', [Novel::class,'addSc']) -// // ->middleware('Throttle:5,60') // 限制 1 分钟内最多 5 次 -// // ->name('Novel@addSc'); - -// # 遍历所有分类,注册路由 -// foreach ($arrRoutes as $Routes) { -// foreach ($Routes['path'] as $strPath) { -// Route::get($strPath, $Routes['class']) -// ->name($Routes['name']) -// ->pattern([ -// 'intTjdj' => '\d+', # 推荐等级 -// 'intPage' => '\d+', # 分页 -// 'intCId' => '\d+', -// 'intSort' => '\d+', -// 'intNovelId' => '\d+', -// 'intZhangJiePaiXu' => '\d+', -// 'strSort' => '\w+', -// 'intStatus' => '\d+', -// ]) -// ->cache([$strPath, 3600, strtoupper($strPath) . '_PAGE']); -// } -// } +// 路由配置文件 +$arrRoutes = [ + // H5/PC 端前缀 + 'prefixes' => [ + 'pc' => ['/pc', '/web', '/desktop', '/index', '/shouye', '/zhuomian'], + 'h5' => '', + ], + + // 通用路径别名 + 'paths' => [ + // 章节相关路径 + 'chapter' => [ + '/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', + '/novel/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', + '/book/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', + '/xiaoshuo-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', + '/novel-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', + '/book-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', + ], + + // 最新章节-特殊页面处理 + 'latest' => [ + '/xiaoshuo/:name-:n_id/chapter/latest', + '/novel/:name-:n_id/chapter/latest', + '/book/:name-:n_id/chapter/latest', + '/xiaoshuo-:name-:n_id/chapter/latest', + '/novel-:name-:n_id/chapter/latest', + '/book-:name-:n_id/chapter/latest', + ], + + // 目录相关路径 + 'catalog' => [ + '/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', + '/novel/:name-:intNovelId/mulu/:strOrder/[:intPage]', + '/book/:name-:intNovelId/mulu/:strOrder/[:intPage]', + '/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', + '/novel/:name-:intNovelId/mulu/:strOrder/[:intPage]', + '/book/:name-:intNovelId/mulu/:strOrder/[:intPage]', + ], + + // 伪小说详情相关路径 + 'kan-novel' => [ + '/kan-xiaoshuo/:name-:n_id', + '/show-novel/:name-:n_id', + '/seo-book/:name-:n_id', + '/show-xiaoshuo-:name-:n_id', + '/see-novel-:name-:n_id', + '/good-book-:name-:n_id', + ], + + // 小说详情相关路径 + 'novel' => [ + '/xiaoshuo/:name-:n_id', + '/novel/:name-:n_id', + '/book/:name-:n_id', + '/xiaoshuo-:name-:n_id', + '/novel-:name-:n_id', + '/book-:name-:n_id', + ], + + // 书库 + 'library' => [ + '/shuku/:strGender/:strCategory/:strStatus/page:intPage', + '/books/:strGender/:strCategory/:strStatus/page:intPage', + '/library/:strGender/:strCategory/:strStatus/page:intPage', + '/fenlei/:strGender/:strCategory/:strStatus/page:intPage', + '/class/:strGender/:strCategory/:strStatus/page:intPage', + '/category/:strGender/:strCategory/:strStatus/page:intPage', + ], + // 书库首页 + 'library-index' => [ + '/shuku/all', + '/books/all', + '/library/all', + '/fenlei/all', + '/class/all', + '/category/all', + ], + //排行榜 + 'rank' => ['/paihang/all', '/rank/all', '/paihang-quan', '/top/all', '/paihang-bang', '/ranks/all'], + // 男生 + 'boys' => ['/nansheng-xiaoshuo', '/boys-novel', '/nansheng-shu', '/man-read', '/nansheng-book', '/male-novels'], + //女生 + 'girls' => ['/nvsheng-xiaoshuo', '/girls-novel', '/nvsheng-shu', '/woman-read', '/nvsheng-book', '/female-novels'], + //搜索 + 'search' => ['/search', '/explore', '/sousuo', '/find', '/query', '/keywords'], + // 用户中心 + 'user' => ['/user', '/my-account', '/profile', '/yonghu', '/wode-zhongxin', '/personal-center'], + //书架 + 'bookshelf' => ['/bookshelf', '/book-shelf', '/reading-shelf', '/shujia', '/yuedu-shujia', '/book-collection'], + //历史记录 + 'history' => ['/history', '/reading-history', '/read-record', '/lishi', '/yuedu-lishi', '/browse-past'], + // 首页 + 'index' => ['/'], + + ], + +]; + +// 遍历路由配置,动态注册 H5 和 PC 路由 +foreach ($arrRoutes['prefixes'] as $platform => $prefixes) { + $prefixes = is_array($prefixes) ? $prefixes : [$prefixes]; + $boolIsMobile = $platform === 'h5'; + foreach ($prefixes as $strPath) { + foreach ($arrRoutes['paths'] as $key => $arrUrl) { + foreach ($arrUrl as $strUrl) { + $strRoute = $strPath . $strUrl; + switch ($key) { + case 'latest': + //最新章节 + Route::get($strRoute, [Novel::class, 'getNovelLatestChapter']) + ->append(['boolIsMobile' => $boolIsMobile]) + ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); + break; + case 'chapter': + //章节 + Route::get($strRoute, [Novel::class, 'getNovelChapter']) + ->append(['boolIsMobile' => $boolIsMobile]) + ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'intChapterSort' => '\d+', 'intChapterPage' => '\d+']); + break; + case 'kan-novel': + //伪造小说详情 + Route::get($strRoute, [Novel::class, 'getKanNovelInfo']) + ->append(['boolIsMobile' => $boolIsMobile]) + ->pattern(['n_id' => '\d+', 'n_forge_id' => '\d+', 'name' => '[\w-]+',]); + break; + case 'novel': + //小说详情 + Route::get($strRoute, [Novel::class, 'getNovelInfo']) + ->append(['boolIsMobile' => $boolIsMobile]) + ->pattern(['n_id' => '\d+', 'name' => '[\w-]+',]); + break; + case 'catalog': + //目录 + Route::get($strRoute, [Novel::class, 'getNovelChapterAll']) + ->append(['boolIsMobile' => $boolIsMobile]) + ->pattern(['intNovelId' => '\d+', 'name' => '[\w-]+', 'strOrder' => 'zheng|dao', 'intPage' => '\d+']); + break; + case 'library': + //书库/分类 + Route::get($strRoute, [Novel::class, 'getLibrary']) + ->append(['boolIsMobile' => $boolIsMobile]) + ->pattern([ + 'strGender' => 'nansheng-xiaoshuo|nvsheng-xiaoshuo|all', + 'strCategory' => '[a-z\-]+', + 'strStatus' => 'all|lianzai|wanjie', + 'intPage' => '\d+' + ]); + break; + case 'library-index': + //书库/分类首页 + Route::get($strRoute, [Novel::class, 'getLibrary'])->append(['boolIsMobile' => $boolIsMobile]); + break; + case 'rank': + //排行榜 + Route::get($strRoute, [Novel::class, 'getNovelRank'])->append(['boolIsMobile' => $boolIsMobile]); + break; + case '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']); + break; + case 'search': + //搜素 + Route::get($strRoute, [Novel::class, 'getSearchNovel'])->ext('html')->append(['boolIsMobile' => $boolIsMobile]); + break; + case 'user': + //用户中心 + Route::get($strRoute, [User::class, 'Index'])->append(['boolIsMobile' => $boolIsMobile]); + break; + case 'bookshelf': + //书架 + Route::get($strRoute, [User::class, 'getBookShelf'])->append(['boolIsMobile' => $boolIsMobile]); + break; + case 'history': + //历史记录 + Route::get($strRoute, [User::class, 'getHistory'])->append(['boolIsMobile' => $boolIsMobile]); + break; + case 'index': + // 首页 + if ($platform == 'h5') { + Route::get($strRoute, [Index::class, 'index'])->append(['boolIsMobile' => $boolIsMobile]); + }else{ + Route::get($strRoute, [Index::class, 'getPcIndex'])->append(['boolIsMobile' => $boolIsMobile]); + } + break; + } + } + } + } +} diff --git a/code/app/home/view/kuangyu/Novel/getNovelChapter.html b/code/app/home/view/kuangyu/Novel/getNovelChapter.html index 3ac8b41..ccf2f93 100644 --- a/code/app/home/view/kuangyu/Novel/getNovelChapter.html +++ b/code/app/home/view/kuangyu/Novel/getNovelChapter.html @@ -17,6 +17,7 @@ + @@ -112,8 +113,8 @@
- {$arrChapter.content|raw} - + +
{$arrGRM[5]|raw} diff --git a/code/app/home/view/kuangyu/Pc/getNovelChapter.html b/code/app/home/view/kuangyu/Pc/getNovelChapter.html index c9823b9..e528a20 100644 --- a/code/app/home/view/kuangyu/Pc/getNovelChapter.html +++ b/code/app/home/view/kuangyu/Pc/getNovelChapter.html @@ -66,6 +66,8 @@ } } + + @@ -202,7 +204,7 @@
{if $arrChapter && $arrChapter.content} - {$arrChapter.content|raw } + {/if}
diff --git a/code/config/routes.php b/code/config/routes.php deleted file mode 100644 index c3ae229..0000000 --- a/code/config/routes.php +++ /dev/null @@ -1,83 +0,0 @@ - ['', '/pc', '/web', '/desktop', '/index', '/shouye', '/zhuomian'], - - // 通用路径别名 - 'paths' => [ - // 书库 - 'library' => [ - '/shuku/:strGender/:strCategory/:strStatus/page:intPage', - '/books/:strGender/:strCategory/:strStatus/page:intPage', - '/library/:strGender/:strCategory/:strStatus/page:intPage', - '/fenlei/:strGender/:strCategory/:strStatus/page:intPage', - '/class/:strGender/:strCategory/:strStatus/page:intPage', - '/category/:strGender/:strCategory/:strStatus/page:intPage', - ], - // 书库首页 - 'library-index' => [ - '/shuku/all', - '/books/all', - '/library/all', - '/fenlei/all', - '/class/all', - '/category/all', - ], - - // 小说详情相关路径 - 'novel' => [ - '/xiaoshuo/:name-:n_id', - '/novel/:name-:n_id', - '/book/:name-:n_id', - '/xiaoshuo-:name-:n_id', - '/novel-:name-:n_id', - '/book-:name-:n_id', - ], - - // 章节相关路径 - 'chapter' => [ - '/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', - '/novel/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', - '/book/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', - '/xiaoshuo-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', - '/novel-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', - '/book-:name-:intNovelId/zhang-:intChapterSort/[:intChapterPage]', - ], - - // 目录相关路径 - 'catalog' => [ - '/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', - '/novel/:name-:intNovelId/mulu/:strOrder/[:intPage]', - '/book/:name-:intNovelId/mulu/:strOrder/[:intPage]', - '/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', - '/novel/:name-:intNovelId/mulu/:strOrder/[:intPage]', - '/book/:name-:intNovelId/mulu/:strOrder/[:intPage]', - ], - - // 最新章节-特殊页面处理 - 'latest' => [ - '/xiaoshuo/:name-:n_id/chapter/latest', - '/novel/:name-:n_id/chapter/latest', - '/book/:name-:n_id/chapter/latest', - '/xiaoshuo-:name-:n_id/chapter/latest', - '/novel-:name-:n_id/chapter/latest', - '/book-:name-:n_id/chapter/latest', - ], - - - 'rank' => ['/paihang/all', '/rank/all', '/paihang-quan', '/top/all', '/paihang-bang', '/ranks/all'], //排行榜 - 'boys' => ['/nansheng-xiaoshuo', '/boys-novel', '/nansheng-shu', '/man-read', '/nansheng-book', '/male-novels'], // 男生 - 'girls' => ['/nvsheng-xiaoshuo', '/girls-novel', '/nvsheng-shu', '/woman-read', '/nvsheng-book', '/female-novels'], //女生 - 'search' => ['/search', '/explore', '/sousuo', '/find', '/query', '/keywords'], //搜索 - 'user' => ['/user', '/my-account', '/profile', '/yonghu', '/wode-zhongxin', '/personal-center'], // 用户中心 - 'bookshelf' => ['/bookshelf', '/book-shelf', '/reading-shelf', '/shujia', '/yuedu-shujia', '/book-collection'], //书架 - 'history' => ['/history', '/reading-history', '/read-record', '/lishi', '/yuedu-lishi', '/browse-past'], // ;历史记录 - 'index' => ['', 'web', 'desktop', 'index', 'shouye'], // 首页,包含空路径 - ], - - -]; diff --git a/code/public/public/js/yueduqsbs.js b/code/public/public/js/yueduqsbs.js new file mode 100644 index 0000000..bcd1b03 --- /dev/null +++ b/code/public/public/js/yueduqsbs.js @@ -0,0 +1,167 @@ +function cleanMaliciousCode(decodedStr) { + // 定义一系列的恶意代码和关键字 + const maliciousPatterns = [ + /eval\s*\(/gi, // 检测 eval + /document\.location/gi, // 页面跳转 + /window\.location/gi, // 页面跳转 + /window\.location\.href/gi, // 页面跳转 + /http:\/\/[^\s]+/gi, // 匹配任何http协议的URL + /https:\/\/[^\s]+/gi, // 匹配任何https协议的URL + /javascript:/gi, // 匹配javascript: + /