链街Dcat后台
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.

76 lines
1.5 KiB

  1. <?php
  2. namespace App\Admin\Actions\Tree;
  3. use Dcat\Admin\Actions\Response;
  4. use Dcat\Admin\Form;
  5. use Dcat\Admin\Traits\HasPermissions;
  6. use Dcat\Admin\Tree\AbstractTool;
  7. use Illuminate\Contracts\Auth\Authenticatable;
  8. use Illuminate\Database\Eloquent\Model;
  9. use Illuminate\Http\Request;
  10. use App\Models\v3\Category as CategoryModel;
  11. class CategoryTie extends AbstractTool
  12. {
  13. /**
  14. * @return string
  15. */
  16. protected $title = '绑定分类到首页导航';
  17. /**
  18. * Handle the action request.
  19. *
  20. * @param Request $request
  21. *
  22. * @return Response
  23. */
  24. public function handle(Request $request)
  25. {
  26. return $this->response()
  27. ->success('跳转到绑定页面' )
  28. ->redirect('/categoryTie');
  29. }
  30. /**
  31. * @return string|void
  32. */
  33. // public function href()
  34. // {
  35. // return admin_url('category/tie');
  36. // }
  37. /**
  38. * @return string|array|void
  39. */
  40. public function confirm()
  41. {
  42. // return ['Confirm?', 'contents'];
  43. }
  44. // protected function actionScript()
  45. // {
  46. // return <<<JS
  47. // function (data, target, action) {
  48. // console.log('发起请求之前', data, target, action);
  49. // // return false; 在这里return false可以终止执行后面的操作
  50. // // 更改传递到接口的主键值
  51. // action.options.key = 123;
  52. // }
  53. // JS;
  54. // }
  55. /**
  56. * @param Model|Authenticatable|HasPermissions|null $user
  57. *
  58. * @return bool
  59. */
  60. protected function authorize($user): bool
  61. {
  62. return true;
  63. }
  64. }