小说第一模板,url修改
This commit is contained in:
@@ -7,21 +7,22 @@ use app\home\controller\Novel;
|
||||
use app\home\controller\User;
|
||||
use think\facade\Route;
|
||||
|
||||
# 路由别名,可以忽略
|
||||
# 路由别名,可以忽略 ->ext('html')
|
||||
// Route::alias("/index.html", "/")->append(['boolIsMobile' => true]);
|
||||
// Route::alias("/pc/index.html", "/")->append(['boolIsMobile' => false]);
|
||||
|
||||
/**
|
||||
* 首页
|
||||
*/
|
||||
Route::get("/", [Index::class,'index'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/index", [Index::class,'index'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get("/pc/index", [Index::class,'getPcIndex'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get("/pc/", [Index::class,'getPcIndex'])->append(['boolIsMobile' => false]);
|
||||
// Route::get("/index", [Index::class,'index'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
// Route::get("/pc/index", [Index::class,'getPcIndex'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
|
||||
// 书架
|
||||
Route::get('bookshelf', [User::class,'getBookShelf'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/bookshelf', [User::class,'getBookShelf'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
//排行榜
|
||||
Route::get('paihang/all', [Novel::class,'getNovelRank'])->append(['boolIsMobile' => true]);
|
||||
Route::get('/paihang/all', [Novel::class,'getNovelRank'])->append(['boolIsMobile' => true]);
|
||||
Route::get("/pc/paihang/all", [Novel::class,'getNovelRank'])->append(['boolIsMobile' => false]);
|
||||
|
||||
/**
|
||||
@@ -40,79 +41,24 @@ Route::get('/pc/nvsheng-xiaoshuo', [Novel::class, 'getNovelChannel'])->append([
|
||||
Route::get('/shuku/all', [Novel::class,'getLibrary'])->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/shuku/all', [Novel::class,'getLibrary'])->append(['boolIsMobile' => false]);
|
||||
Route::get('/shuku/:strNovelChannel-:strCategory-:strStatus-:intPage', [Novel::class,'getLibrary'])
|
||||
->pattern([
|
||||
'strNovelChannel' => '[\w]*',
|
||||
'strCategory' => '[\w]*',
|
||||
'strStatus' => '[\w]*',
|
||||
'intPage' => '\d+'
|
||||
])
|
||||
->append(['boolIsMobile' => true]);
|
||||
->pattern([
|
||||
'strNovelChannel' => '[\w]*',
|
||||
'strCategory' => '[\w]*',
|
||||
'strStatus' => '[\w]*',
|
||||
'intPage' => '\d+'
|
||||
])
|
||||
->append(['boolIsMobile' => true]);
|
||||
|
||||
Route::get('/pc/shuku/:strNovelChannel-:strCategory-:strStatus-:intPage', [Novel::class,'getLibrary'])
|
||||
->pattern([
|
||||
'strNovelChannel' => '[\w]*',
|
||||
'strCategory' => '[\w]*',
|
||||
'strStatus' => '[\w]*',
|
||||
'intPage' => '\d+'
|
||||
])
|
||||
->append(['boolIsMobile' => false]);
|
||||
->pattern([
|
||||
'strNovelChannel' => '[\w]*',
|
||||
'strCategory' => '[\w]*',
|
||||
'strStatus' => '[\w]*',
|
||||
'intPage' => '\d+'
|
||||
])
|
||||
->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/<intCategoryId]-[:intPage]', 'Novel/getNovelCategory')
|
||||
// ->append(['boolIsMobile' => false])
|
||||
// ->pattern(['intCategoryId' => '\d+','intPage' => '\d+',])
|
||||
// ->ext('html');
|
||||
|
||||
|
||||
// 文章 列表
|
||||
Route::get('/article/list-[:intCategoryId]-[:intPage]', [Novel::class,'getArticleList'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/article/list-[:intCategoryId]-[:intPage]', [Novel::class,'getArticleList'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/article/list', [Novel::class,'getArticleList'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/article/list', [Novel::class,'getArticleList'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// 文章 详情
|
||||
Route::get('/article/info-:intArticleId', [Novel::class,'getArticleInfo'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/article/info-:intArticleId', [Novel::class,'getArticleInfo'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
/**
|
||||
* 小说详情
|
||||
* /book/{strPinYin}-{intNId}.html
|
||||
* /novel/{strPinYin}-{intNId}.html
|
||||
* /novel-{strPinYin}-{intNId}.html
|
||||
* /book-{strPinYin}-{intNId}.html
|
||||
*/
|
||||
Route::get('/pc/book/:name-:n_id', [Novel::class, 'getNovelInfo'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 1])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',])
|
||||
->ext('html');
|
||||
|
||||
Route::get('/pc/novel/:name-:n_id', [Novel::class, 'getNovelInfo'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 2])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',])
|
||||
->ext('html');
|
||||
|
||||
Route::get('/pc/novel-:name-:n_id', [Novel::class, 'getNovelInfo'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 3])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',])
|
||||
->ext('html');
|
||||
|
||||
Route::get('/pc/book-:name-:n_id', [Novel::class, 'getNovelInfo'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 4])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',])
|
||||
->ext('html');
|
||||
|
||||
// 最新章节-特殊页面处理
|
||||
Route::get('/pc/books/:name-:n_id/chapter/latest', [Novel::class, 'getNovelNewsChapter'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 1])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',])
|
||||
->ext('html');
|
||||
|
||||
/**
|
||||
* 小说章节
|
||||
* /xiaoshuo/小说拼音-小说id/zhang-章节排序/章节分页
|
||||
@@ -126,6 +72,13 @@ Route::get('/pc/xiaoshuo/:name-:intNovelId/zhang-:intChapterSort/[:intChapterPag
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 1])
|
||||
->pattern(['intNovelId' => '\d+','name' => '[\w-]+','intChapterSort' => '\d+','intChapterPage' => '\d+']);
|
||||
|
||||
/**
|
||||
* 最新章节-特殊页面处理
|
||||
*/
|
||||
Route::get('/pc/books/:name-:n_id/chapter/latest', [Novel::class, 'getNovelNewsChapter'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 1])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',]);
|
||||
|
||||
|
||||
/**
|
||||
* 小说目录页面
|
||||
@@ -139,24 +92,84 @@ Route::get('/pc/xiaoshuo/:name-:intNovelId/mulu/:strOrder/[:intPage]', [Novel::c
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 1])
|
||||
->pattern(['intNovelId' => '\d+','name' => '[\w-]+','strOrder' => 'zheng|dao','intPage' => '\d+']);
|
||||
|
||||
/**
|
||||
* 小说详情
|
||||
* /book/{strPinYin}-{intNId}
|
||||
* /novel/{strPinYin}-{intNId}
|
||||
* /xiaoshuo/{strPinYin}-{intNId}
|
||||
* /book-{strPinYin}-{intNId}
|
||||
* /novel-{strPinYin}-{intNId}
|
||||
* /xiaoshuo-{strPinYin}-{intNId}
|
||||
*/
|
||||
Route::get('/pc/book/:name-:n_id', [Novel::class, 'getNovelInfo'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 1])
|
||||
->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/xiaoshuo/: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' => 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/xiaoshuo-:name-:n_id', [Novel::class, 'getNovelInfo'])
|
||||
->append(['boolIsMobile' => false, 'intUriType' => 3])
|
||||
->pattern(['n_id' => '\d+','name' => '[\w-]+',]);
|
||||
|
||||
|
||||
// 搜索小说
|
||||
Route::get('search', [Novel::class,'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('pc/search', [Novel::class,'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/search', [Novel::class,'getSearchNovel'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/search', [Novel::class,'getSearchNovel'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
|
||||
// 小说用户中心
|
||||
Route::get('/user', [User::class,'Index'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/user', [User::class,'Index'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/user', [User::class,'Index'])->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/user', [User::class,'Index'])->append(['boolIsMobile' => false]);
|
||||
|
||||
|
||||
// 书架
|
||||
Route::get('/bookshelf', [User::class,'getBookShelf'])->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/bookshelf', [User::class,'getBookShelf'])->append(['boolIsMobile' => false]);
|
||||
|
||||
// 历史记录
|
||||
Route::get('history', [User::class,'getHistory'])->ext('html')->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/history', [User::class,'getHistory'])->ext('html')->append(['boolIsMobile' => false]);
|
||||
Route::get('/history', [User::class,'getHistory'])->append(['boolIsMobile' => true]);
|
||||
Route::get('/pc/history', [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/<intCategoryId]-[:intPage]', 'Novel/getNovelCategory')
|
||||
// ->append(['boolIsMobile' => false])
|
||||
// ->pattern(['intCategoryId' => '\d+','intPage' => '\d+',])
|
||||
// ->ext('html');
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user