You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
4.6 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Web Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here is where you can register web routes for your application. These
  8. | routes are loaded by the RouteServiceProvider within a group which
  9. | contains the "web" middleware group. Now create something great!
  10. |
  11. */
  12. //wap路由,要放到最前面,否则解析不到
  13. Route::group(['domain' => env('APP_SUBDOMAIN'), 'namespace' => 'Wap'], function () {
  14. Route::get('/', 'IndexController@index');
  15. Route::get('/tags', 'IndexController@tags');
  16. Route::get('/search', 'IndexController@search');
  17. Route::get('/cat{cat}/id{id}', 'IndexController@detail'); //详情页
  18. Route::get('/cat{cat}/{page}', 'IndexController@category'); //分类页,分页
  19. Route::get('/cat{cat}', 'IndexController@category'); //分类页
  20. Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页
  21. Route::get('/tag{tag}', 'IndexController@tag'); //标签页
  22. Route::get('/{id}', 'IndexController@page'); //单页
  23. Route::get('/aaa', function () {
  24. dd('wap');
  25. });
  26. });
  27. //前台路由
  28. Route::group(['namespace' => 'Home'], function () {
  29. Route::get('/', 'IndexController@index');
  30. Route::get('/tags', 'IndexController@tags');
  31. Route::get('/search', 'IndexController@search');
  32. Route::get('/cat{cat}/id{id}', 'IndexController@detail'); //详情页
  33. Route::get('/cat{cat}/{page}', 'IndexController@category'); //分类页,分页
  34. Route::get('/cat{cat}', 'IndexController@category'); //分类页
  35. Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页
  36. Route::get('/tag{tag}', 'IndexController@tag'); //标签页
  37. Route::get('/{id}', 'IndexController@page'); //单页
  38. Route::get('/aaa', function () {
  39. dd('wap');
  40. });
  41. });
  42. //后台路由
  43. Route::group(['prefix' => 'Admin'], function () {
  44. Route::get('/bbb', function () {
  45. // 匹配 "/fladmin/users" URL
  46. });
  47. });
  48. //接口路由
  49. Route::group(['prefix' => 'Api'], function () {
  50. Route::get('/ccc', function () {
  51. // 匹配 "/api/users" URL
  52. });
  53. });
  54. //中间件
  55. Route::group(['middleware' => 'auth'], function () {
  56. Route::get('/qwe', function () {
  57. // 使用 Auth 中间件
  58. });
  59. Route::get('user/profile', function () {
  60. // 使用 Auth 中间件
  61. });
  62. });
  63. //https://github.com/cong5/myPersimmon
  64. //前台
  65. /* Route::group(['namespace' => 'App'], function () {
  66. Route::get('/', 'HomeController@index')->name('home');
  67. Route::get('/post/{flag}', 'HomeController@posts')->name('post');
  68. Route::get('/tags/{flag}', 'HomeController@tags')->name('tags');
  69. Route::get('/category/{flag}', 'HomeController@category')->name('category');
  70. Route::get('/feed', 'HomeController@feed');
  71. Route::get('/sitemap.xml', 'HomeController@siteMap');
  72. Route::get('/xmlrpc', 'XmlRpcController@errorMessage');
  73. Route::post('/xmlrpc', 'XmlRpcController@index')->name('xmlrpc');
  74. Route::get('/friends', 'HomeController@friends')->name('friends');
  75. Route::resource('/comment', 'CommentController');
  76. Route::get('/debug', 'HomeController@debug')->name('debug');
  77. });
  78. //后台
  79. Route::group(['prefix' => 'myp', 'namespace' => 'Backend'], function () {
  80. Route::get('/', 'DashboardController@dashboard')->name('admin');
  81. Route::post('/auth/check', 'AuthController@check')->name('admin.login_check');
  82. Route::post('/auth/logout', 'AuthController@logout')->name('admin.logout');
  83. Route::post('/auth/login', 'AuthController@authenticate')->name('admin.login');
  84. });
  85. Route::group(['prefix' => 'myp', 'middleware' => 'auth', 'namespace' => 'Backend'], function () {
  86. Route::get('/dashboard/meta', 'DashboardController@meta');
  87. Route::get('/dashboard/shanbay', 'DashboardController@shanbay');
  88. Route::resource('/categorys', 'CategorysController');
  89. Route::resource('/posts', 'PostsController');
  90. Route::resource('/tags', 'TagsController');
  91. Route::resource('/links', 'LinksController');
  92. Route::resource('/options', 'OptionsController');
  93. Route::resource('/settings', 'SettingsController');
  94. Route::resource('/navigations', 'NavigationController');
  95. Route::resource('/uploads', 'FileController');
  96. Route::resource('/util', 'UtilController');
  97. Route::resource('/user', 'UserController');
  98. Route::resource('/comments', 'CommentController');
  99. Route::resource('/trash', 'TrashController');
  100. }); */