admin.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <?php
  2. /**
  3. * @Created by PhpStorm
  4. * @author: Kirin
  5. * @day: 2024/11/19
  6. * @time: 11:16
  7. */
  8. use app\http\middleware\admin\AdminAuthTokenMiddleware;
  9. use app\http\middleware\admin\AdminCheckRoleMiddleware;
  10. use app\http\middleware\admin\AdminLogMiddleware;
  11. use app\http\middleware\AllowOriginMiddleware;
  12. use app\http\middleware\StationOpenMiddleware;
  13. use think\facade\Route;
  14. Route::group('adminapi', function () {
  15. //无需登录
  16. Route::group(function () {
  17. //图形验证码
  18. Route::get('ajcaptcha', 'Login/ajcaptcha')->name('ajcaptcha');
  19. //图形验证码
  20. Route::post('ajcheck', 'Login/ajcheck')->name('ajcheck');
  21. //是否需要滑块验证接口
  22. Route::post('is_captcha', 'Login/getAjCaptcha')->name('getAjCaptcha');
  23. //验证码
  24. Route::get('captcha_pro', 'Login/captcha')->name('')->option(['real_name' => '获取验证码']);
  25. //用户名密码登录
  26. Route::post('login', 'Login/login')->name('AdminLogin')->option(['real_name' => '用户名密码登录']);
  27. //后台登录页面数据
  28. Route::get('login/info', 'Login/info')->option(['real_name' => '登录信息']);
  29. //管理员退出登陆
  30. Route::get('logout', 'Login/logout')->name('SystemAdminLogout')->option(['real_name' => '退出登陆']);
  31. });
  32. Route::group(function () {
  33. //需登录,但不需要权限
  34. Route::group(function () {
  35. Route::get('info', 'Common/adminInfo')->option(['real_name' => '获取后台用户信息']);
  36. //获取搜索菜单列表
  37. Route::get('menusList', 'Common/menusList')->option(['real_name' => '搜索菜单列表']);
  38. //获取logo
  39. Route::get('logo', 'Common/getLogo')->option(['real_name' => '获取logo']);
  40. //获取城市数据
  41. Route::get('city', 'Common/city')->option(['real_name' => '获取城市数据']);
  42. });
  43. //需登录,也需要权限
  44. Route::group(function () {
  45. //用户管理
  46. Route::group('user', function () {
  47. Route::get('typeHeader', 'user.User/typeHeader')->option(['real_name' => '获取用户类型头部数据']);
  48. Route::get('detail/:type/:id', 'user.User/oneUserInfo')->option(['real_name' => '获取单个用户信息']);
  49. Route::post('giveLevel/:uid', 'user.User/give_level')->option(['real_name' => '赠送等级']);
  50. Route::delete('delLevel/:uid', 'user.User/del_level')->option(['real_name' => '清除等级']);
  51. Route::put('setGroup', 'user.User/set_group')->option(['real_name' => '设置分组']);
  52. Route::put('updateAccount/:uid', 'user.User/updateAccount')->option(['real_name' => '编辑用户账户']);
  53. Route::put('set_status/:id/:status', 'user.User/set_status')->option(['real_name' => '编辑用户状态']);
  54. });
  55. //财务管理
  56. Route::group('finance', function () {
  57. });
  58. Route::group('log', function () {
  59. Route::get('', 'system.SystemLogs/index')->option(['real_name' => '系统日志列表']);
  60. Route::get('/:id', 'system.SystemLogs/detail')->option(['real_name' => '系统日志详情']);
  61. });
  62. Route::group('menus', function () {
  63. //修改权限规格显示状态
  64. Route::put('show/:id', 'system.SystemMenus/show')->name('SystemMenusShow')->option(['real_name' => '修改权限规格显示状态']);
  65. //未添加的权限规则列表
  66. Route::get('ruleList', 'system.SystemMenus/ruleList')->option(['real_name' => '未添加的权限规则列表']);
  67. });
  68. //修改管理员身份状态
  69. Route::put('roles/set_status/:id/:status', 'system.SystemRoles/setStatus')->option(['real_name' => '修改管理员身份状态']);
  70. //修改管理员状态
  71. Route::put('admins/set_status/:id/:status', 'system.SystemAdmins/setStatus')->option(['real_name' => '修改管理员状态']);
  72. //修改当前管理员信息
  73. Route::put('update_admin', 'system.SystemAdmins/update_admin')->name('SystemAdminUpdateAdmin')->option(['real_name' => '修改当前管理员信息']);
  74. //修改配置分类状态
  75. Route::put('config_class/set_status/:id/:status', 'system.config.SystemConfigTab/setStatus')->option(['real_name' => '修改配置分类状态']);
  76. //获取配置分类树状表
  77. Route::get('config_class/select', 'system.config.SystemConfigTab/getSelectForm')->option(['real_name' => '获取配置分类树状表']);
  78. //基本配置编辑头部数据
  79. Route::get('config/header_basics', 'system.config.SystemConfig/header_basics')->option(['real_name' => '基本配置编辑头部数据']);
  80. //获取配置数据
  81. Route::get('config/read/:id', 'system.config.SystemConfig/readConfig')->option(['real_name' => '获取配置数据']);
  82. //积分配置保存数据
  83. Route::post('config/save', 'system.config.SystemConfig/saveConfig')->option(['real_name' => '积分配置保存数据']);
  84. //修改配置状态
  85. Route::put('config/set_status/:id/:status', 'v1.system.config.SystemConfig/setStatus')->option(['real_name' => '修改配置状态']);
  86. //用户等级关闭/启用
  87. Route::put('user_level/set_status/:id/:status', 'system.config.SystemUserLevel/setStatus')->option(['real_name' => '用户等级关闭/启用']);
  88. //用户等级快速修改
  89. Route::put('user_level/set_value', 'system.config.SystemUserLevel/setValue')->option(['real_name' => '用户等级快速修改']);
  90. //等级任务模板
  91. Route::get('user_level/task_base', 'system.config.SystemUserLevel/getTaskBase')->option(['real_name' => '等级任务模板']);
  92. //附件管理
  93. Route::group('file', function () {
  94. //图片附件列表
  95. Route::get('', 'system.attachment.SystemAttachment/index')->option(['real_name' => '图片附件列表']);
  96. //删除图片
  97. Route::post('delete', 'system.attachment.SystemAttachment/batchDelete')->option(['real_name' => '删除图片']);
  98. //移动图片分类
  99. Route::put('move', 'system.attachment.SystemAttachment/moveImageCate')->option(['real_name' => '移动图片分类']);
  100. //修改图片名称
  101. Route::put('update/:id', 'system.attachment.SystemAttachment/update')->option(['real_name' => '修改图片名称']);
  102. //上传图片
  103. Route::post('upload/[:upload_type]', 'system.attachment.SystemAttachment/upload')->option(['real_name' => '上传图片']);
  104. //获取上传key
  105. Route::get('temp_key', 'system.attachment.SystemAttachment/getTempKeys')->option(['real_name' => '获取上传key']);
  106. //分片上传本地视频
  107. Route::post('video_upload', 'system.attachment.SystemAttachment/videoUpload')->option(['real_name' => '分片上传本地视频']);
  108. //oss视频素材保存
  109. Route::post('video_attachment', 'system.attachment.SystemAttachment/saveVideoAttachment')->option(['real_name' => '视频素材保存']);
  110. //网络图片上传
  111. Route::post('online/upload', 'system.attachment.SystemAttachment/onlineUpload')->option(['real_name' => '网络图片上传']);
  112. //附件分类管理资源路由
  113. Route::resource('category', 'system.attachment.SystemAttachmentCategory')
  114. ->only(['index', 'read', 'save', 'update', 'delete'])
  115. ->option(['real_name' => [
  116. 'index' => '获取附件分类列表',
  117. 'read' => '获取附件分类详情',
  118. 'save' => '保存附件分类',
  119. 'update' => '修改附件分类',
  120. 'delete' => '删除附件分类'
  121. ]]);
  122. });
  123. //清除数据
  124. Route::post('clear_data/:type', 'system.SystemClearData/clear')->option(['real_name' => '清除数据']);
  125. //替换域名
  126. Route::post('replace_site_url', 'system.SystemClearData/replaceSiteUrl')->option(['real_name' => '替换域名']);
  127. //短信发送记录
  128. Route::get('sms_record', 'system.SmsRecord/index')->option(['real_name' => '短信发送记录']);
  129. //用户分组资源路由
  130. Route::resource('user', 'user.User')
  131. ->only(['index', 'read', 'save', 'update', 'delete'])
  132. ->option(['real_name' => [
  133. 'index' => '用户列表',
  134. 'read' => '用户详情',
  135. 'save' => '保存用户',
  136. 'update' => '修改用户',
  137. 'delete' => '注销用户'
  138. ]]);
  139. //用户分组资源路由
  140. Route::resource('user_group', 'user.UserGroup')
  141. ->only(['index', 'read', 'save', 'update', 'delete'])
  142. ->option(['real_name' => [
  143. 'index' => '用户分组列表',
  144. 'read' => '用户分组详情',
  145. 'save' => '保存用户分组',
  146. 'update' => '修改用户分组',
  147. 'delete' => '删除用户分组'
  148. ]]);
  149. //用户分组资源路由
  150. Route::resource('user_level', 'system.config.SystemUserLevel')
  151. ->only(['index', 'read', 'save', 'update', 'delete'])
  152. ->option(['real_name' => [
  153. 'index' => '用户等级列表',
  154. 'read' => '用户等级详情',
  155. 'save' => '保存等级分组',
  156. 'update' => '修改等级分组',
  157. 'delete' => '删除等级分组'
  158. ]]);
  159. //权限菜单资源路由
  160. Route::resource('menus', 'system.SystemMenus')
  161. ->only(['index', 'read', 'save', 'update', 'delete'])
  162. ->option(['real_name' => [
  163. 'index' => '获取权限菜单列表',
  164. 'read' => '获取权限菜单详情',
  165. 'save' => '保存权限菜单',
  166. 'update' => '修改权限菜单',
  167. 'delete' => '删除权限菜单'
  168. ]]);
  169. //身份资源路由
  170. Route::resource('roles', 'system.SystemRoles')
  171. ->only(['index', 'read', 'save', 'update', 'delete'])
  172. ->option(['real_name' => [
  173. 'index' => '获取身份列表',
  174. 'read' => '获取身份详情',
  175. 'save' => '保存身份',
  176. 'update' => '修改身份',
  177. 'delete' => '删除身份'
  178. ]]);
  179. //管理员资源路由
  180. Route::resource('admins', 'system.SystemAdmins')
  181. ->only(['index', 'read', 'save', 'update', 'delete'])
  182. ->option(['real_name' => [
  183. 'index' => '获取管理员列表',
  184. 'read' => '获取管理员详情',
  185. 'save' => '保存管理员',
  186. 'update' => '修改管理员',
  187. 'delete' => '删除管理员'
  188. ]]);
  189. //系统配置分类资源路由
  190. Route::resource('config_class', 'system.config.SystemConfigTab')
  191. ->only(['index', 'read', 'save', 'update', 'delete'])->option(['real_name' => [
  192. 'index' => '获取系统配置分类列表',
  193. 'read' => '获取系统配置分类详情',
  194. 'save' => '保存系统配置分类',
  195. 'update' => '修改系统配置分类',
  196. 'delete' => '删除系统配置分类'
  197. ]]);
  198. //系统配置资源路由
  199. Route::resource('config', 'system.config.SystemConfig')
  200. ->only(['index', 'read', 'save', 'update', 'delete'])->option(['real_name' => [
  201. 'index' => '获取系统配置列表',
  202. 'read' => '获取系统配置详情',
  203. 'save' => '保存系统配置',
  204. 'update' => '修改系统配置',
  205. 'delete' => '删除系统配置'
  206. ]]);
  207. })->middleware(AdminCheckRoleMiddleware::class);
  208. })->middleware(AdminAuthTokenMiddleware::class)->middleware(AdminLogMiddleware::class);
  209. })->prefix('admin.')->middleware(AllowOriginMiddleware::class);