routes.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use App\Admin\Controllers\DistAppearanceTemplateController;
  3. use Illuminate\Routing\Router;
  4. use Illuminate\Support\Facades\Route;
  5. use Dcat\Admin\Admin;
  6. Admin::routes();
  7. Route::group([
  8. 'prefix' => config('admin.route.prefix'),
  9. 'namespace' => config('admin.route.namespace'),
  10. 'middleware' => config('admin.route.middleware'),
  11. ], function (Router $router) {
  12. //主页
  13. $router->get('/', 'HomeController@index');
  14. // 定义切换语言的路由
  15. $router->get('language-switch','LanguageController@index');
  16. // 不需要登录的路由
  17. $router->get('captcha','CaptchaController@generate');
  18. //文件夹
  19. $router->resource('site-folder', 'SiteAlbumFolderController');
  20. //相册
  21. $router->resource('site-album', 'SiteAlbumController');
  22. });
  23. /*
  24. * 重写上传路由,修改tinymce上传路径
  25. */
  26. $attributes = [
  27. 'prefix' => admin_base_path('dcat-api'),
  28. 'middleware' => config('admin.route.middleware'),
  29. 'as' => 'dcat-api.',
  30. ];
  31. app('router')->group($attributes, function ($router) {
  32. $router->post('editor-md/upload', function () {exit;})->name('editor-md.upload');
  33. $router->post('tinymce/upload', 'App\Http\Controllers\TinymceController@upload')->name('tinymce.upload');
  34. });