RoleController.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 LARAVEL研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: laravel开发员 <laravel.qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Http\Controllers\Admin;
  12. use App\Services\Common\RoleService;
  13. /**
  14. * 角色管理-控制器
  15. * @author laravel开发员
  16. * @since 2020/11/11
  17. * Class RoleController
  18. * @package App\Http\Controllers
  19. */
  20. class RoleController extends Backend
  21. {
  22. /**
  23. * 构造函数
  24. * @author laravel开发员
  25. * @since 2020/11/11
  26. * RoleController constructor.
  27. */
  28. public function __construct()
  29. {
  30. parent::__construct();
  31. $this->service = new RoleService();
  32. }
  33. /**
  34. * 获取角色列表
  35. * @return mixed
  36. * @since 2020/11/11
  37. * @author laravel开发员
  38. */
  39. public function getRoleList()
  40. {
  41. $type = request()->all('type', 1);
  42. $result = $this->service->getRoleList($type);
  43. return $result;
  44. }
  45. /**
  46. * 获取角色权限列表
  47. * @author laravel开发员
  48. * @since 2020/11/11
  49. */
  50. public function getPermissionList()
  51. {
  52. $result = $this->service->getPermissionList();
  53. return $result;
  54. }
  55. /**
  56. * 保存权限
  57. * @return mixed
  58. * @since 2020/11/11
  59. * @author laravel开发员
  60. */
  61. public function savePermission()
  62. {
  63. $result = $this->service->savePermission();
  64. return $result;
  65. }
  66. }