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.

270 lines
15 KiB

8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
7 years ago
8 years ago
8 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
7 years ago
7 years ago
8 years ago
7 years ago
7 years ago
7 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')->name('wap_home');
  15. Route::get('/page404', 'IndexController@page404')->name('wap_page404'); //404页面
  16. Route::get('/tags', 'IndexController@tags')->name('wap_tags');
  17. Route::get('/search/{id}', 'IndexController@search')->name('wap_search'); //搜过页面
  18. Route::get('/p/{id}', 'IndexController@detail')->name('wap_detail'); //详情页
  19. Route::get('/cat{cat}/{page}', 'IndexController@category'); //分类页,分页
  20. Route::get('/cat{cat}', 'IndexController@category')->name('wap_category'); //分类页
  21. Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页
  22. Route::get('/tag{tag}', 'IndexController@tag')->name('wap_tag'); //标签页
  23. Route::get('/page/{id}', 'IndexController@page')->name('wap_singlepage'); //单页
  24. Route::get('/goods/{id}', 'IndexController@goods')->name('wap_goods'); //商品详情页
  25. Route::get('/goodstype{cat}/{page}', 'IndexController@goodstype'); //产品分类页,分页
  26. Route::get('/goodstype{cat}', 'IndexController@goodstype')->name('wap_goodstype'); //产品分类页
  27. Route::get('/sitemap.xml', 'IndexController@sitemap')->name('wap_sitemap'); //sitemap
  28. });
  29. //前台路由
  30. Route::group(['namespace' => 'Home'], function () {
  31. Route::get('/', 'IndexController@index')->name('home');
  32. Route::get('/page404', 'IndexController@page404')->name('page404'); //404页面
  33. Route::get('/tags', 'IndexController@tags')->name('home_tags');
  34. Route::get('/search/{id}', 'IndexController@search')->name('home_search'); //搜过页面
  35. Route::get('/p/{id}', 'IndexController@detail')->name('home_detail'); //详情页
  36. Route::get('/cat{cat}/{page}', 'IndexController@category'); //分类页,分页
  37. Route::get('/cat{cat}', 'IndexController@category')->name('home_category'); //分类页
  38. Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页
  39. Route::get('/tag{tag}', 'IndexController@tag')->name('home_tag'); //标签页
  40. Route::get('/page/{id}', 'IndexController@page')->name('home_singlepage'); //单页
  41. Route::get('/goods/{id}', 'IndexController@goods')->name('home_goods'); //商品详情页
  42. Route::get('/goodstype{cat}/{page}', 'IndexController@goodstype'); //产品分类页,分页
  43. Route::get('/goodstype{cat}', 'IndexController@goodstype')->name('home_goodstype'); //产品分类页
  44. Route::get('/sitemap.xml', 'IndexController@sitemap')->name('home_sitemap');//sitemap
  45. Route::get('/test', 'IndexController@test')->name('home_test'); //测试
  46. Route::get('/aaa', function () {
  47. dd('wap');
  48. });
  49. });
  50. //后台路由
  51. Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['web']], function () {
  52. Route::get('/', 'IndexController@index')->name('admin');
  53. Route::get('/welcome', 'IndexController@welcome')->name('admin_welcome');
  54. Route::get('/index/upconfig', 'IndexController@upconfig')->name('admin_index_upconfig'); //更新系统参数配置
  55. Route::get('/index/upcache', 'IndexController@upcache')->name('admin_index_upcache'); //更新缓存
  56. //文章
  57. Route::get('/article', 'ArticleController@index')->name('admin_article');
  58. Route::get('/article/add', 'ArticleController@add')->name('admin_article_add');
  59. Route::post('/article/doadd', 'ArticleController@doadd')->name('admin_article_doadd');
  60. Route::get('/article/edit', 'ArticleController@edit')->name('admin_article_edit');
  61. Route::post('/article/doedit', 'ArticleController@doedit')->name('admin_article_doedit');
  62. Route::get('/article/del', 'ArticleController@del')->name('admin_article_del');
  63. Route::get('/article/repetarc', 'ArticleController@repetarc')->name('admin_article_repetarc');
  64. Route::get('/article/recommendarc', 'ArticleController@recommendarc')->name('admin_article_recommendarc');
  65. Route::get('/article/articleexists', 'ArticleController@articleexists')->name('admin_article_articleexists');
  66. //栏目
  67. Route::get('/category', 'CategoryController@index')->name('admin_category');
  68. Route::get('/category/add', 'CategoryController@add')->name('admin_category_add');
  69. Route::post('/category/doadd', 'CategoryController@doadd')->name('admin_category_doadd');
  70. Route::get('/category/edit', 'CategoryController@edit')->name('admin_category_edit');
  71. Route::post('/category/doedit', 'CategoryController@doedit')->name('admin_category_doedit');
  72. Route::get('/category/del', 'CategoryController@del')->name('admin_category_del');
  73. //标签
  74. Route::get('/tag', 'TagController@index')->name('admin_tag');
  75. Route::get('/tag/add', 'TagController@add')->name('admin_tag_add');
  76. Route::post('/tag/doadd', 'TagController@doadd')->name('admin_tag_doadd');
  77. Route::get('/tag/edit', 'TagController@edit')->name('admin_tag_edit');
  78. Route::post('/tag/doedit', 'TagController@doedit')->name('admin_tag_doedit');
  79. Route::get('/tag/del', 'TagController@del')->name('admin_tag_del');
  80. //单页
  81. Route::get('/page', 'PageController@index')->name('admin_page');
  82. Route::get('/page/add', 'PageController@add')->name('admin_page_add');
  83. Route::post('/page/doadd', 'PageController@doadd')->name('admin_page_doadd');
  84. Route::get('/page/edit', 'PageController@edit')->name('admin_page_edit');
  85. Route::post('/page/doedit', 'PageController@doedit')->name('admin_page_doedit');
  86. Route::get('/page/del', 'PageController@del')->name('admin_page_del');
  87. //产品
  88. Route::get('/goods', 'GoodsController@index')->name('admin_goods');
  89. Route::get('/goods/add', 'GoodsController@add')->name('admin_goods_add');
  90. Route::post('/goods/doadd', 'GoodsController@doadd')->name('admin_goods_doadd');
  91. Route::get('/goods/edit', 'GoodsController@edit')->name('admin_goods_edit');
  92. Route::post('/goods/doedit', 'GoodsController@doedit')->name('admin_goods_doedit');
  93. Route::get('/goods/del', 'GoodsController@del')->name('admin_goods_del');
  94. Route::get('/goods/recommendarc', 'GoodsController@recommendarc')->name('admin_goods_recommendarc');
  95. Route::get('/goods/articleexists', 'GoodsController@goodsexists')->name('admin_goods_goodsexists');
  96. //产品分类
  97. Route::get('/goodstype', 'GoodsTypeController@index')->name('admin_goodstype');
  98. Route::get('/goodstype/add', 'GoodsTypeController@add')->name('admin_goodstype_add');
  99. Route::post('/goodstype/doadd', 'GoodsTypeController@doadd')->name('admin_goodstype_doadd');
  100. Route::get('/goodstype/edit', 'GoodsTypeController@edit')->name('admin_goodstype_edit');
  101. Route::post('/goodstype/doedit', 'GoodsTypeController@doedit')->name('admin_goodstype_doedit');
  102. Route::get('/goodstype/del', 'GoodsTypeController@del')->name('admin_goodstype_del');
  103. //友情链接
  104. Route::get('/friendlink', 'FriendlinkController@index')->name('admin_friendlink');
  105. Route::get('/friendlink/add', 'FriendlinkController@add')->name('admin_friendlink_add');
  106. Route::post('/friendlink/doadd', 'FriendlinkController@doadd')->name('admin_friendlink_doadd');
  107. Route::get('/friendlink/edit', 'FriendlinkController@edit')->name('admin_friendlink_edit');
  108. Route::post('/friendlink/doedit', 'FriendlinkController@doedit')->name('admin_friendlink_doedit');
  109. Route::get('/friendlink/del', 'FriendlinkController@del')->name('admin_friendlink_del');
  110. //关键词管理
  111. Route::get('/keyword', 'KeywordController@index')->name('admin_keyword');
  112. Route::get('/keyword/add', 'KeywordController@add')->name('admin_keyword_add');
  113. Route::post('/keyword/doadd', 'KeywordController@doadd')->name('admin_keyword_doadd');
  114. Route::get('/keyword/edit', 'KeywordController@edit')->name('admin_keyword_edit');
  115. Route::post('/keyword/doedit', 'KeywordController@doedit')->name('admin_keyword_doedit');
  116. Route::get('/keyword/del', 'KeywordController@del')->name('admin_keyword_del');
  117. //搜索关键词
  118. Route::get('/searchword', 'SearchwordController@index')->name('admin_searchword');
  119. Route::get('/searchword/add', 'SearchwordController@add')->name('admin_searchword_add');
  120. Route::post('/searchword/doadd', 'SearchwordController@doadd')->name('admin_searchword_doadd');
  121. Route::get('/searchword/edit', 'SearchwordController@edit')->name('admin_searchword_edit');
  122. Route::post('/searchword/doedit', 'SearchwordController@doedit')->name('admin_searchword_doedit');
  123. Route::get('/searchword/del', 'SearchwordController@del')->name('admin_searchword_del');
  124. //幻灯片
  125. Route::get('/slide', 'SlideController@index')->name('admin_slide');
  126. Route::get('/slide/add', 'SlideController@add')->name('admin_slide_add');
  127. Route::post('/slide/doadd', 'SlideController@doadd')->name('admin_slide_doadd');
  128. Route::get('/slide/edit', 'SlideController@edit')->name('admin_slide_edit');
  129. Route::post('/slide/doedit', 'SlideController@doedit')->name('admin_slide_doedit');
  130. Route::get('/slide/del', 'SlideController@del')->name('admin_slide_del');
  131. //在线留言管理
  132. Route::get('/guestbook', 'GuestbookController@index')->name('admin_guestbook');
  133. Route::get('/guestbook/del', 'GuestbookController@del')->name('admin_guestbook_del');
  134. //系统参数配置
  135. Route::get('/sysconfig', 'SysconfigController@index')->name('admin_sysconfig');
  136. Route::get('/sysconfig/add', 'SysconfigController@add')->name('admin_sysconfig_add');
  137. Route::post('/sysconfig/doadd', 'SysconfigController@doadd')->name('admin_sysconfig_doadd');
  138. Route::get('/sysconfig/edit', 'SysconfigController@edit')->name('admin_sysconfig_edit');
  139. Route::post('/sysconfig/doedit', 'SysconfigController@doedit')->name('admin_sysconfig_doedit');
  140. Route::get('/sysconfig/del', 'SysconfigController@del')->name('admin_sysconfig_del');
  141. //用户管理
  142. Route::get('/user', 'UserController@index')->name('admin_user');
  143. Route::get('/user/add', 'UserController@add')->name('admin_user_add');
  144. Route::post('/user/doadd', 'UserController@doadd')->name('admin_user_doadd');
  145. Route::get('/user/edit', 'UserController@edit')->name('admin_user_edit');
  146. Route::post('/user/doedit', 'UserController@doedit')->name('admin_user_doedit');
  147. Route::get('/user/del', 'UserController@del')->name('admin_user_del');
  148. //角色管理
  149. Route::get('/userrole', 'UserRoleController@index')->name('admin_userrole');
  150. Route::get('/userrole/add', 'UserRoleController@add')->name('admin_userrole_add');
  151. Route::post('/userrole/doadd', 'UserRoleController@doadd')->name('admin_userrole_doadd');
  152. Route::get('/userrole/edit', 'UserRoleController@edit')->name('admin_userrole_edit');
  153. Route::post('/userrole/doedit', 'UserRoleController@doedit')->name('admin_userrole_doedit');
  154. Route::get('/userrole/del', 'UserRoleController@del')->name('admin_userrole_del');
  155. Route::get('/userrole/permissions', 'UserRoleController@permissions')->name('admin_userrole_permissions'); //权限设置
  156. Route::post('/userrole/dopermissions', 'UserRoleController@dopermissions')->name('admin_userrole_dopermissions');
  157. //菜单管理
  158. Route::get('/menu', 'MenuController@index')->name('admin_menu');
  159. Route::get('/menu/add', 'MenuController@add')->name('admin_menu_add');
  160. Route::post('/menu/doadd', 'MenuController@doadd')->name('admin_menu_doadd');
  161. Route::get('/menu/edit', 'MenuController@edit')->name('admin_menu_edit');
  162. Route::post('/menu/doedit', 'MenuController@doedit')->name('admin_menu_doedit');
  163. Route::get('/menu/del', 'MenuController@del')->name('admin_menu_del');
  164. //后台登录注销
  165. Route::get('/login', 'LoginController@login')->name('admin_login');
  166. Route::post('/dologin', 'LoginController@dologin')->name('admin_dologin');
  167. Route::get('/logout', 'LoginController@logout')->name('admin_logout');
  168. Route::get('/recoverpwd', 'LoginController@recoverpwd')->name('admin_recoverpwd');
  169. //页面跳转
  170. Route::get('/jump', 'LoginController@jump')->name('admin_jump');
  171. //测试
  172. Route::get('/test', 'LoginController@test')->name('admin_test');
  173. });
  174. //接口路由,无需token验证
  175. Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web']], function () {
  176. });
  177. //接口路由,需token验证
  178. Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web','token']], function () {
  179. //轮播图
  180. Route::get('/slide_list', 'SlideController@slideList');
  181. //收货地址
  182. Route::get('/user_address_list', 'UserAddressController@userAddressList');
  183. Route::get('/user_address_detail', 'UserAddressController@userAddressDetail');
  184. Route::post('/user_address_setdefault', 'UserAddressController@userAddressSetDefault');
  185. Route::post('/user_address_add', 'UserAddressController@userAddressAdd');
  186. Route::post('/user_address_update', 'UserAddressController@userAddressUpdate');
  187. Route::post('/user_address_delete', 'UserAddressController@userAddressDelete');
  188. //地区,省市区
  189. Route::get('/region_list', 'RegionController@regionList');
  190. Route::get('/region_detail', 'RegionController@regionDetail');
  191. });
  192. //中间件
  193. Route::group(['middleware' => 'auth'], function () {
  194. Route::get('/qwe', function () {
  195. // 使用 Auth 中间件
  196. });
  197. Route::get('user/profile', function () {
  198. // 使用 Auth 中间件
  199. });
  200. });
  201. //https://github.com/cong5/myPersimmon
  202. //前台
  203. /* Route::group(['namespace' => 'App'], function () {
  204. Route::get('/', 'HomeController@index')->name('home');
  205. Route::get('/post/{flag}', 'HomeController@posts')->name('post');
  206. Route::get('/tags/{flag}', 'HomeController@tags')->name('tags');
  207. Route::get('/category/{flag}', 'HomeController@category')->name('category');
  208. Route::get('/feed', 'HomeController@feed');
  209. Route::get('/sitemap.xml', 'HomeController@siteMap');
  210. Route::get('/xmlrpc', 'XmlRpcController@errorMessage');
  211. Route::post('/xmlrpc', 'XmlRpcController@index')->name('xmlrpc');
  212. Route::get('/friends', 'HomeController@friends')->name('friends');
  213. Route::resource('/comment', 'CommentController');
  214. Route::get('/debug', 'HomeController@debug')->name('debug');
  215. });
  216. //后台
  217. Route::group(['prefix' => 'myp', 'namespace' => 'Backend'], function () {
  218. Route::get('/', 'DashboardController@dashboard')->name('admin');
  219. Route::post('/auth/check', 'AuthController@check')->name('admin.login_check');
  220. Route::post('/auth/logout', 'AuthController@logout')->name('admin.logout');
  221. Route::post('/auth/login', 'AuthController@authenticate')->name('admin.login');
  222. });
  223. Route::group(['prefix' => 'myp', 'middleware' => 'auth', 'namespace' => 'Backend'], function () {
  224. Route::get('/dashboard/meta', 'DashboardController@meta');
  225. Route::get('/dashboard/shanbay', 'DashboardController@shanbay');
  226. Route::resource('/categorys', 'CategorysController');
  227. Route::resource('/posts', 'PostsController');
  228. Route::resource('/tags', 'TagsController');
  229. Route::resource('/links', 'LinksController');
  230. Route::resource('/options', 'OptionsController');
  231. Route::resource('/settings', 'SettingsController');
  232. Route::resource('/navigations', 'NavigationController');
  233. Route::resource('/uploads', 'FileController');
  234. Route::resource('/util', 'UtilController');
  235. Route::resource('/user', 'UserController');
  236. Route::resource('/comments', 'CommentController');
  237. Route::resource('/trash', 'TrashController');
  238. }); */