attachment.php 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. use think\facade\Route;
  12. use app\common\middleware\AdminAuthMiddleware;
  13. use app\common\middleware\AdminTokenMiddleware;
  14. use app\common\middleware\AllowOriginMiddleware;
  15. use app\common\middleware\LogMiddleware;
  16. Route::group(function () {
  17. //附件分类管理
  18. Route::group('system/attachment/category', function () {
  19. Route::get('formatLst', '/getFormatList')->name('systemAttachmentCategoryGetFormatList')->option([
  20. '_alias' => '素材分类列表',
  21. ]);
  22. Route::get('create/form', '/createForm')->name('systemAttachmentCategoryCreateForm')->option([
  23. '_alias' => '素材分类添加表单',
  24. '_auth' => false,
  25. '_form' => 'systemAttachmentCategoryCreate',
  26. ]);
  27. Route::get('update/form/:id', '/updateForm')->name('systemAttachmentCategoryUpdateForm')->option([
  28. '_alias' => '素材分类编辑表单',
  29. '_auth' => false,
  30. '_form' => 'systemAttachmentCategoryUpdate',
  31. ]);
  32. Route::post('create', '/create')->name('systemAttachmentCategoryCreate')->option([
  33. '_alias' => '素材分类添加',
  34. ]);
  35. Route::post('update/:id', '/update')->name('systemAttachmentCategoryUpdate')->option([
  36. '_alias' => '素材编辑',
  37. ]);
  38. Route::delete('delete/:id', '/delete')->name('systemAttachmentCategoryDelete')->option([
  39. '_alias' => '素材删除',
  40. ]);
  41. })->prefix('admin.system.attachment.AttachmentCategory')->option([
  42. '_path' => '/config/picture',
  43. '_auth' => true,
  44. ]);
  45. Route::group('system/attachment', function () {
  46. Route::get('lst', '/getList')->name('systemAttachmentLst')->option([
  47. '_alias' => '素材列表',
  48. ]);
  49. Route::delete('delete', '/delete')->name('systemAttachmentDelete')->option([
  50. '_alias' => '素材删除',
  51. ]);
  52. Route::post('category', '/batchChangeCategory')->name('systemAttachmentBatchChangeCategory')->option([
  53. '_alias' => '批量移动',
  54. ]);
  55. Route::get('update/:id/form', '/updateForm')->name('systemAttachmentUpdateForm')->option([
  56. '_alias' => '素材编辑表单',
  57. '_auth' => false,
  58. '_form' => 'systemAttachmentUpdate',
  59. ]);
  60. Route::post('update/:id', '/update')->name('systemAttachmentUpdate')->option([
  61. '_alias' => '素材编辑',
  62. ]);
  63. })->prefix('admin.system.attachment.Attachment')->option([
  64. '_path' => '/config/picture',
  65. '_auth' => true,
  66. ]);
  67. Route::post('upload/image/:id/:field', 'admin.system.attachment.Attachment/image')->name('uploadImage')->option([
  68. '_alias' => '上传图片',
  69. '_path' => '/config/picture',
  70. ]);
  71. })->middleware(AllowOriginMiddleware::class)
  72. ->middleware(AdminTokenMiddleware::class, true)
  73. ->middleware(AdminAuthMiddleware::class)
  74. ->middleware(LogMiddleware::class);