FormatMenuPath.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\command;
  13. use app\common\repositories\system\auth\MenuRepository;
  14. use think\console\Command;
  15. use think\console\Input;
  16. use think\console\Output;
  17. /**
  18. * Class FormatMenuPath
  19. * @package app\command
  20. * @author xaboy
  21. * @day 2020/8/26
  22. */
  23. class FormatMenuPath extends Command
  24. {
  25. /**
  26. * @author xaboy
  27. * @day 2020/8/26
  28. */
  29. protected function configure()
  30. {
  31. // 指令配置
  32. $this->setName('menu:format')
  33. ->setDescription('the format menu command');
  34. }
  35. /**
  36. * @param Input $input
  37. * @param Output $output
  38. * @return int|void|null
  39. * @author xaboy
  40. * @day 2020/8/26
  41. */
  42. protected function execute(Input $input, Output $output)
  43. {
  44. $output->writeln('开启修复');
  45. $menuRepository = app()->make(MenuRepository::class);
  46. $menuRepository->formatPath(0);
  47. $menuRepository->formatPath(1);
  48. $output->writeln('执行成功');
  49. }
  50. }