menu.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <?php
  2. return [
  3. // 超级管理员角色ID(可以配置多个)
  4. 'super_admin_role_ids' => [1],
  5. // 菜单配置
  6. 'menus' => [
  7. [
  8. 'id' => 1,
  9. 'title' => '玩家管理',
  10. 'icon' => 'layui-icon-set',
  11. 'controller' => '',
  12. 'url' => '',
  13. 'sort' => 1,
  14. 'level' => 1,
  15. 'parent_id' => 0,
  16. 'children' => [
  17. [
  18. 'id' => 11,
  19. 'title' => '玩家列表',
  20. 'icon' => 'layui-icon-user',
  21. 'controller' => 'Player',
  22. 'url' => '/view/player/list.html',
  23. 'sort' => 1,
  24. 'level' => 2,
  25. 'parent_id' => 1,
  26. 'actions' => [
  27. 'list' => '查看玩家列表',
  28. 'detail' => '查看玩家详情',
  29. 'updateStatus' => '更新玩家状态',
  30. 'updateAdjustStatus' => '更新玩家调控状态',
  31. 'statistics' => '查看玩家统计',
  32. 'batchUpdate' => '批量更新玩家',
  33. 'export' => '导出玩家数据'
  34. ]
  35. ]
  36. ]
  37. ],
  38. [
  39. 'id' => 2,
  40. 'title' => '游戏调控',
  41. 'icon' => 'layui-icon-store',
  42. 'controller' => '',
  43. 'url' => '',
  44. 'sort' => 2,
  45. 'level' => 1,
  46. 'parent_id' => 0,
  47. 'children' => [
  48. [
  49. 'id' => 21,
  50. 'title' => '游戏列表',
  51. 'icon' => 'layui-icon-app',
  52. 'controller' => 'Game',
  53. 'url' => '/view/game/list.html',
  54. 'sort' => 1,
  55. 'level' => 2,
  56. 'parent_id' => 2,
  57. 'actions' => [
  58. 'list' => '查看游戏列表',
  59. 'detail' => '查看游戏详情',
  60. 'create' => '创建游戏',
  61. 'update' => '更新游戏',
  62. 'updateStatus' => '更新游戏状态',
  63. 'batchUpdate' => '批量更新游戏',
  64. 'delete' => '删除游戏',
  65. 'statistics' => '查看游戏统计',
  66. 'export' => '导出游戏数据'
  67. ]
  68. ],
  69. [
  70. 'id' => 22,
  71. 'title' => '游戏管理',
  72. 'icon' => 'layui-icon-set',
  73. 'controller' => '',
  74. 'url' => '',
  75. 'sort' => 2,
  76. 'level' => 2,
  77. 'parent_id' => 2,
  78. 'children' => [
  79. [
  80. 'id' => 221,
  81. 'title' => '游戏配置',
  82. 'icon' => '',
  83. 'controller' => 'Game',
  84. 'url' => '/view/game/config.html',
  85. 'sort' => 1,
  86. 'level' => 3,
  87. 'parent_id' => 22,
  88. 'actions' => [],
  89. ],
  90. [
  91. 'id' => 222,
  92. 'title' => '批量维护',
  93. 'icon' => '',
  94. 'controller' => 'Game',
  95. 'url' => '/view/game/batch.html',
  96. 'sort' => 2,
  97. 'level' => 3,
  98. 'parent_id' => 22,
  99. 'actions' => [],
  100. ]
  101. ]
  102. ]
  103. ]
  104. ],
  105. [
  106. 'id' => 3,
  107. 'title' => '权限管理',
  108. 'icon' => 'layui-icon-chart',
  109. 'controller' => '',
  110. 'url' => '',
  111. 'sort' => 3,
  112. 'level' => 1,
  113. 'parent_id' => 0,
  114. 'children' => [
  115. [
  116. 'id' => 31,
  117. 'title' => '角色列表',
  118. 'icon' => 'layui-icon-chart-screen',
  119. 'controller' => 'UserRole',
  120. 'url' => '/statistics/user',
  121. 'sort' => 1,
  122. 'level' => 2,
  123. 'parent_id' => 3,
  124. 'actions' => [
  125. 'list' => '查看角色列表',
  126. 'create' => '创建角色',
  127. 'update' => '编辑角色',
  128. 'delete' => '删除角色',
  129. 'detail' => '查看角色详情',
  130. 'permissions' => '查看权限配置'
  131. ]
  132. ],
  133. [
  134. 'id' => 32,
  135. 'title' => '账号列表',
  136. 'icon' => 'layui-icon-data',
  137. 'controller' => 'User',
  138. 'url' => '/statistics/merchant',
  139. 'sort' => 2,
  140. 'level' => 2,
  141. 'parent_id' => 3,
  142. 'actions' => [
  143. 'list' => '查看用户列表',
  144. 'create' => '创建用户',
  145. 'update' => '编辑用户',
  146. 'delete' => '删除用户',
  147. 'detail' => '查看用户详情'
  148. ]
  149. ]
  150. ]
  151. ]
  152. ],
  153. // 权限组合(用于快速分配角色权限)
  154. 'permission_groups' => [
  155. 'viewer' => [
  156. 'name' => '查看者',
  157. 'description' => '只有查看权限',
  158. 'permissions' => [
  159. 'User' => ['list', 'detail'],
  160. 'Player' => ['list', 'detail', 'statistics'],
  161. 'Game' => ['list', 'detail', 'statistics'],
  162. 'UserRole' => ['list', 'detail'],
  163. 'Statistics' => ['user', 'merchant']
  164. ]
  165. ],
  166. 'operator' => [
  167. 'name' => '操作员',
  168. 'description' => '有基本的增删改查权限',
  169. 'permissions' => [
  170. 'User' => ['list', 'create', 'update', 'detail'],
  171. 'Player' => ['list', 'detail', 'updateStatus', 'statistics'],
  172. 'Game' => ['list', 'detail', 'updateStatus', 'statistics'],
  173. 'UserRole' => ['list', 'detail'],
  174. 'Statistics' => ['user', 'merchant']
  175. ]
  176. ],
  177. 'admin' => [
  178. 'name' => '管理员',
  179. 'description' => '有完整的管理权限',
  180. 'permissions' => [
  181. 'User' => ['list', 'create', 'update', 'delete', 'detail'],
  182. 'Player' => ['list', 'detail', 'updateStatus', 'updateAdjustStatus', 'statistics', 'batchUpdate', 'export'],
  183. 'Game' => ['list', 'detail', 'create', 'update', 'updateStatus', 'batchUpdate', 'delete', 'statistics', 'export'],
  184. 'UserRole' => ['list', 'create', 'update', 'delete', 'detail', 'permissions'],
  185. 'Menu' => ['getUserMenus', 'getAllPermissions'],
  186. 'Statistics' => ['user', 'merchant']
  187. ]
  188. ]
  189. ]
  190. ];