routes.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. use Illuminate\Http\Request;
  3. use Illuminate\Routing\Router;
  4. use Illuminate\Support\Facades\Route;
  5. use Dcat\Admin\Admin;
  6. /**
  7. * 原后台框架路由
  8. */
  9. Admin::routes();
  10. Route::group([
  11. 'prefix' => config('admin.route.prefix'),
  12. 'namespace' => config('admin.route.namespace'),
  13. 'middleware' => config('admin.route.middleware'),
  14. ], function (Router $router) {
  15. //主页
  16. $router->get('/', 'HomeController@index');
  17. //产品
  18. //$router->get('base-product/parameter', 'DistProductController@parameter');
  19. $router->resource('dist-product', 'DistProductController');
  20. //分类
  21. $router->resource('product-category', 'DistProductCategoryController');
  22. //参数
  23. //$router->resource('product-parameter', 'DistProductParameterController');
  24. //视频分类
  25. $router->resource('video-category', 'DistVideoCategoryController');
  26. //视频管理
  27. $router->resource('dist-video', 'DistVideoController');
  28. //产品导入
  29. $router->get('import-product', 'ImportProductController@index');
  30. $router->get('import-product/{id}', 'ImportProductController@show');
  31. //询价管理
  32. $router->get('dist-inquiry', 'DistInquiryController@index');
  33. $router->get('dist-inquiry/{id}','DistInquiryController@show');
  34. //配置
  35. $router->get('dist-settings', 'SettingsController@index');
  36. $router->post('dist-settings', 'SettingsController@store');
  37. $router->post('dist-settings/upload', 'SettingsController@upload');
  38. $router->get('dist-cache', 'CacheController@index');
  39. $router->post('dist-cache/clear', 'CacheController@clear');
  40. //外观选择
  41. $router->get('dist-appearance', 'DistAppearanceController@index');
  42. //菜单管理
  43. $router->get('site-menu', 'SiteMenuController@index');//列表
  44. $router->get('site-menu/create','SiteMenuController@create');//新增
  45. $router->post('site-menu', 'SiteMenuController@store');//新增保存
  46. $router->get('site-menu/{id}/edit', 'SiteMenuController@edit');//编辑
  47. $router->put('site-menu/{id}', 'SiteMenuController@update');//编辑保存
  48. $router->delete('site-menu/{id}', 'SiteMenuController@destroy');//删除
  49. //文章管理
  50. $router->resource('site-pages', 'SitePagesController');
  51. $router->resource('site-pages-tag', 'SitePagesTagController');
  52. //banner管理
  53. $router->resource('site-banner', 'SiteBannerController');
  54. //API相关
  55. $router->get('api/products', 'ApiController@products');
  56. $router->get('api/pages', 'ApiController@pages');
  57. $router->get('api/landing-pages', 'ApiController@landingPages');
  58. $router->get('api/tag', 'ApiController@tag');
  59. $router->get('api/generate-slug', 'ApiController@generateSlug');
  60. $router->get('api/videos', 'ApiController@videos');
  61. // 定义切换语言的路由
  62. $router->get('language-switch','LanguageController@index');
  63. // 不需要登录的路由
  64. $router->get('captcha','CaptchaController@generate');
  65. $router->resource('messages', 'DistMessageController');
  66. //可视化编辑器
  67. $router->get('visual-editor', 'VisualEditorController@index');
  68. $router->post('visual-editor/upload', 'VisualEditorController@upload');
  69. $router->post('visual-editor/preview-save', 'VisualEditorController@previewSave');
  70. $router->post('visual-editor/publish', 'VisualEditorController@publish');
  71. //宣传资料
  72. $router->get('site-album', 'SiteAlbumController@index');
  73. $router->get('site-album/{id}', 'SiteAlbumController@show');
  74. //社媒账号管理
  75. $router->get('ssm-user-account', 'SmmUserAccountController@index');
  76. });
  77. /*
  78. * 重写上传路由,修改tinymce上传路径
  79. */
  80. $attributes = [
  81. 'prefix' => admin_base_path('dcat-api'),
  82. 'middleware' => config('admin.route.middleware'),
  83. 'as' => 'dcat-api.',
  84. ];
  85. app('router')->group($attributes, function ($router) {
  86. $router->post('editor-md/upload', function () {exit;})->name('editor-md.upload');
  87. $router->post('tinymce/upload', 'App\Http\Controllers\TinymceController@upload')->name('tinymce.upload');
  88. });
  89. /*
  90. * 对外开放的接口
  91. */
  92. Route::group([
  93. 'prefix' => 'open',
  94. 'namespace' => config('admin.route.namespace'),
  95. ], function (Router $router) {
  96. //社媒回调
  97. $router->get('callback/{name}', 'SmmUserAccountController@callback');
  98. });