setting.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. use think\facade\Route;
  12. /**
  13. * 系统设置维护 系统权限管理、系统菜单管理 系统配置 相关路由
  14. */
  15. Route::group('setting', function () {
  16. /** 管理员 */
  17. Route::group(function () {
  18. //管理员资源路由
  19. Route::resource('admin', 'v1.setting.SystemAdmin')->except(['read'])->option([
  20. 'real_name' => [
  21. 'index' => '获取管理员列表',
  22. 'create' => '获取管理员表单',
  23. 'save' => '保存管理员',
  24. 'edit' => '获取修改管理员表单',
  25. 'update' => '修改管理员',
  26. 'delete' => '删除管理员'
  27. ]
  28. ]);
  29. //退出登陆
  30. Route::get('admin/logout', 'v1.setting.SystemAdmin/logout')->name('SystemAdminLogout')->option(['real_name' => '退出登陆']);
  31. //修改状态
  32. Route::put('set_status/:id/:status', 'v1.setting.SystemAdmin/set_status')->name('SystemAdminSetStatus')->option(['real_name' => '修改管理员状态']);
  33. //获取当前管理员信息
  34. Route::get('info', 'v1.setting.SystemAdmin/info')->name('SystemAdminInfo')->option(['real_name' => '获取当前管理员信息']);
  35. //修改当前管理员信息
  36. Route::put('update_admin', 'v1.setting.SystemAdmin/update_admin')->name('SystemAdminUpdateAdmin')->option(['real_name' => '修改当前管理员信息']);
  37. //设置文件管理密码
  38. Route::put('set_file_password', 'v1.setting.SystemAdmin/set_file_password')->name('SystemAdminSetFilePassword')->option(['real_name' => '设置当前文件管理密码']);
  39. })->option(['parent' => 'setting', 'cate_name' => '管理员']);
  40. /** 权限菜单 */
  41. Route::group(function () {
  42. //获取菜单权限和权限标识
  43. Route::get('menus/unique', 'v1.setting.SystemMenus/unique')->name('SystemMenusUnique')->option(['real_name' => '获取菜单权限和权限标识']);
  44. //批量保存权限
  45. Route::post('menus/batch', 'v1.setting.SystemMenus/batchSave')->name('SystemMenusBatchSave')->option(['real_name' => '批量保存权限']);
  46. //权限菜单资源路由
  47. Route::resource('menus', 'v1.setting.SystemMenus')->option([
  48. 'real_name' => [
  49. 'index' => '获取权限菜单列表',
  50. 'create' => '获取权限菜单表单',
  51. 'save' => '保存权限菜单',
  52. 'edit' => '获取修改权限菜单表单',
  53. 'read' => '查看权限菜单信息',
  54. 'update' => '修改权限菜单',
  55. 'delete' => '删除权限菜单'
  56. ],
  57. ]);
  58. //未添加的权限规则列表
  59. Route::get('ruleList', 'v1.setting.SystemMenus/ruleList')->option(['real_name' => '权限规则列表']);
  60. //权限规则分类
  61. Route::get('rule_cate', 'v1.setting.SystemMenus/ruleCate')->option(['real_name' => '权限规则分类']);
  62. //修改显示
  63. Route::put('menus/show/:id', 'v1.setting.SystemMenus/show')->name('SystemMenusShow')->option(['real_name' => '修改权限规格显示状态']);
  64. })->option(['parent' => 'setting', 'cate_name' => '权限菜单']);
  65. /** 管理员身份 */
  66. Route::group(function () {
  67. //身份列表
  68. Route::get('role', 'v1.setting.SystemRole/index')->option(['real_name' => '管理员身份列表']);
  69. //身份权限列表
  70. Route::get('role/create', 'v1.setting.SystemRole/create')->option(['real_name' => '管理员身份权限列表']);
  71. //编辑详情
  72. Route::get('role/:id/edit', 'v1.setting.SystemRole/edit')->option(['real_name' => '编辑管理员详情']);
  73. //保存新建或编辑
  74. Route::post('role/:id', 'v1.setting.SystemRole/save')->option(['real_name' => '新建或编辑管理员']);
  75. //修改身份状态
  76. Route::put('role/set_status/:id/:status', 'v1.setting.SystemRole/set_status')->option(['real_name' => '修改管理员身份状态']);
  77. //删除身份
  78. Route::delete('role/:id', 'v1.setting.SystemRole/delete')->option(['real_name' => '删除管理员身份']);
  79. })->option(['parent' => 'setting', 'cate_name' => '管理员身份']);
  80. /** 系统配置 */
  81. Route::group(function () {
  82. //配置分类资源路由
  83. Route::resource('config_class', 'v1.setting.SystemConfigTab')->except(['read'])->option([
  84. 'real_name' => [
  85. 'index' => '获取系统配置分类列表',
  86. 'create' => '获取系统配置分类表单',
  87. 'save' => '保存系统配置分类',
  88. 'edit' => '获取修改系统配置分类表单',
  89. 'update' => '修改系统配置分类',
  90. 'delete' => '删除系统配置分类'
  91. ],
  92. ]);
  93. //修改配置分类状态
  94. Route::put('config_class/set_status/:id/:status', 'v1.setting.SystemConfigTab/set_status')->option(['real_name' => '修改配置分类状态']);
  95. //配置资源路由
  96. Route::resource('config', 'v1.setting.SystemConfig')->except(['read'])->option([
  97. 'real_name' => [
  98. 'index' => '获取系统配置列表',
  99. 'create' => '获取系统配置表单',
  100. 'save' => '保存系统配置',
  101. 'edit' => '获取修改系统配置表单',
  102. 'update' => '修改系统配置',
  103. 'delete' => '删除系统配置'
  104. ]
  105. ]);
  106. //修改配置状态
  107. Route::put('config/set_status/:id/:status', 'v1.setting.SystemConfig/set_status')->option(['real_name' => '修改配置状态']);
  108. //基本配置编辑表单
  109. Route::get('config/header_basics', 'v1.setting.SystemConfig/header_basics')->option(['real_name' => '基本配置编辑头部数据']);
  110. //基本配置编辑表单
  111. Route::get('config/edit_basics', 'v1.setting.SystemConfig/edit_basics')->option(['real_name' => '基本配置编辑表单']);
  112. //基本配置保存数据
  113. Route::post('config/save_basics', 'v1.setting.SystemConfig/save_basics')->option(['real_name' => '基本配置保存数据']);
  114. //基本配置上传文件
  115. Route::post('config/upload', 'v1.setting.SystemConfig/file_upload')->option(['real_name' => '基本配置上传文件']);
  116. //获取单个配置值
  117. Route::get('config/get_system/:name', 'v1.setting.SystemConfig/get_system')->option(['real_name' => '基本配置编辑表单']);
  118. //获取某个分类下的所有配置信息
  119. Route::get('config_list/:tabId', 'v1.setting.SystemConfig/get_config_list')->option(['real_name' => '获取某个分类下的所有配置信息']);
  120. })->option(['parent' => 'setting', 'cate_name' => '系统配置']);
  121. /** 组合数据 */
  122. Route::group(function () {
  123. //组合数据资源路由
  124. Route::resource('group', 'v1.setting.SystemGroup')->option([
  125. 'real_name' => [
  126. 'index' => '获取组合数据列表',
  127. 'create' => '获取组合数据表单',
  128. 'save' => '保存组合数据',
  129. 'edit' => '获取修改组合数据表单',
  130. 'update' => '修改组合数据',
  131. 'delete' => '删除组合数据'
  132. ]
  133. ]);
  134. //组合数据全部
  135. Route::get('group_all', 'v1.setting.SystemGroup/getGroup')->option(['real_name' => '组合数据全部']);
  136. //组合数据子数据资源路由
  137. Route::resource('group_data', 'v1.setting.SystemGroupData')->except(['read'])->option([
  138. 'real_name' => [
  139. 'index' => '获取组合数据子数据列表',
  140. 'create' => '获取组合数据子数据表单',
  141. 'save' => '保存组合数据子数据',
  142. 'edit' => '获取修改组合数据子数据表单',
  143. 'update' => '修改组合数据子数据',
  144. 'delete' => '删除组合数据子数据'
  145. ]
  146. ]);
  147. //修改数据状态
  148. Route::get('group_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '组合数据头部']);
  149. //修改数据状态
  150. Route::put('group_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '修改组合数据状态']);
  151. //数据配置保存
  152. Route::post('group_data/save_all', 'v1.setting.SystemGroupData/saveAll')->option(['real_name' => '提交数据配置']);
  153. //获取客服广告
  154. Route::get('get_kf_adv', 'v1.setting.SystemGroupData/getKfAdv')->option(['real_name' => '获取客服广告']);
  155. //设置客服广告
  156. Route::post('set_kf_adv', 'v1.setting.SystemGroupData/setKfAdv')->option(['real_name' => '设置客服广告']);
  157. //签到天数配置资源
  158. Route::resource('sign_data', 'v1.setting.SystemGroupData')->except(['read'])->option([
  159. 'real_name' => [
  160. 'index' => '获取签到天数配置列表',
  161. 'create' => '获取签到天数配置表单',
  162. 'save' => '保存签到天数配置',
  163. 'edit' => '获取修改签到天数配置表单',
  164. 'update' => '修改签到天数配置',
  165. 'delete' => '删除签到天数配置'
  166. ]
  167. ]);
  168. //签到数据字段
  169. Route::get('sign_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '签到数据头部']);
  170. //修改签到数据状态
  171. Route::put('sign_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '修改签到数据状态']);
  172. //订单详情动态图配置资源
  173. Route::resource('order_data', 'v1.setting.SystemGroupData')->except(['read'])->option([
  174. 'real_name' => [
  175. 'index' => '获取订单详情动态图列表',
  176. 'create' => '获取订单详情动态图表单',
  177. 'save' => '保存订单详情动态图',
  178. 'edit' => '获取修改订单详情动态图表单',
  179. 'update' => '修改订单详情动态图',
  180. 'delete' => '删除订单详情动态图'
  181. ]
  182. ]);
  183. //订单数据字段
  184. Route::get('order_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '订单数据字段']);
  185. //订单数据状态
  186. Route::put('order_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '订单数据状态']);
  187. //个人中心菜单配置资源
  188. Route::resource('usermenu_data', 'v1.setting.SystemGroupData')->except(['read'])->option([
  189. 'real_name' => [
  190. 'index' => '获取个人中心菜单列表',
  191. 'create' => '获取个人中心菜单表单',
  192. 'save' => '保存个人中心菜单',
  193. 'edit' => '获取修改个人中心菜单表单',
  194. 'update' => '修改个人中心菜单',
  195. 'delete' => '删除个人中心菜单'
  196. ]
  197. ]);
  198. //个人中心菜单数据字段
  199. Route::get('usermenu_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '个人中心菜单数据字段']);
  200. //个人中心菜单数据状态
  201. Route::put('usermenu_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '个人中心菜单数据状态']);
  202. //分享海报配置资源
  203. Route::resource('poster_data', 'v1.setting.SystemGroupData')->except(['read'])->option([
  204. 'real_name' => [
  205. 'index' => '获取分享海报列表',
  206. 'create' => '获取分享海报表单',
  207. 'save' => '保存分享海报',
  208. 'edit' => '获取修改分享海报表单',
  209. 'update' => '修改分享海报',
  210. 'delete' => '删除分享海报'
  211. ]
  212. ]);
  213. //分享海报数据字段
  214. Route::get('poster_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '分享海报数据字段']);
  215. //分享海报数据状态
  216. Route::put('poster_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '分享海报数据状态']);
  217. //秒杀配置资源
  218. Route::resource('seckill_data', 'v1.setting.SystemGroupData')->except(['read'])->option([
  219. 'real_name' => [
  220. 'index' => '获取分秒杀配置列表',
  221. 'create' => '获取秒杀配置表单',
  222. 'save' => '保存秒杀配置',
  223. 'edit' => '获取修改秒杀配置表单',
  224. 'update' => '修改秒杀配置',
  225. 'delete' => '删除秒杀配置'
  226. ]
  227. ]);
  228. //秒杀数据字段
  229. Route::get('seckill_data/header', 'v1.setting.SystemGroupData/header')->option(['real_name' => '秒杀数据字段']);
  230. //秒杀数据状态
  231. Route::put('seckill_data/set_status/:id/:status', 'v1.setting.SystemGroupData/set_status')->option(['real_name' => '秒杀数据状态']);
  232. //获取隐私协议
  233. Route::get('get_user_agreement', 'v1.setting.SystemGroupData/getUserAgreement')->option(['real_name' => '获取隐私协议']);
  234. //设置隐私协议
  235. Route::post('set_user_agreement', 'v1.setting.SystemGroupData/setUserAgreement')->option(['real_name' => '设置隐私协议']);
  236. })->option(['parent' => 'setting', 'cate_name' => '组合数据']);
  237. /** 城市数据 */
  238. Route::group(function () {
  239. //获取城市数据完整列表
  240. Route::get('city/full_list', 'v1.setting.SystemCity/fullList')->option(['real_name' => '获取城市数据完整列表']);
  241. //获取城市数据列表
  242. Route::get('city/list/:parent_id', 'v1.setting.SystemCity/index')->option(['real_name' => '获取城市数据列表']);
  243. //添加城市数据表单
  244. Route::get('city/add/:parent_id', 'v1.setting.SystemCity/add')->option(['real_name' => '添加城市数据表单']);
  245. //修改城市数据表单
  246. Route::get('city/:id/edit', 'v1.setting.SystemCity/edit')->option(['real_name' => '修改城市数据表单']);
  247. //新增/修改城市数据
  248. Route::post('city/save', 'v1.setting.SystemCity/save')->option(['real_name' => '新增/修改城市数据']);
  249. //修改城市数据表单
  250. Route::delete('city/del/:city_id', 'v1.setting.SystemCity/delete')->option(['real_name' => '删除城市数据']);
  251. //清除城市数据缓存
  252. Route::get('city/clean_cache', 'v1.setting.SystemCity/clean_cache')->option(['real_name' => '清除城市数据缓存']);
  253. })->option(['parent' => 'setting', 'cate_name' => '城市数据']);
  254. /** 运费模版 */
  255. Route::group(function () {
  256. //运费模板列表
  257. Route::get('shipping_templates/list', 'v1.setting.ShippingTemplates/temp_list')->option(['real_name' => '运费模板列表']);
  258. //修改运费模板数据
  259. Route::get('shipping_templates/:id/edit', 'v1.setting.ShippingTemplates/edit')->option(['real_name' => '修改运费模板数据']);
  260. //保存新增修改
  261. Route::post('shipping_templates/save/:id', 'v1.setting.ShippingTemplates/save')->option(['real_name' => '新增或修改运费模版']);
  262. //删除运费模板
  263. Route::delete('shipping_templates/del/:id', 'v1.setting.ShippingTemplates/delete')->option(['real_name' => '删除运费模板']);
  264. //城市数据接口
  265. Route::get('shipping_templates/city_list', 'v1.setting.ShippingTemplates/city_list')->option(['real_name' => '城市数据接口']);
  266. })->option(['parent' => 'setting', 'cate_name' => '运费模版']);
  267. /** 系统通知 */
  268. Route::group(function () {
  269. //系统通知列表
  270. Route::get('notification/index', 'v1.setting.SystemNotification/index')->option(['real_name' => '系统通知列表']);
  271. //获取单条数据
  272. Route::get('notification/info', 'v1.setting.SystemNotification/info')->option(['real_name' => '获取单条通知数据']);
  273. //保存通知设置
  274. Route::post('notification/save', 'v1.setting.SystemNotification/save')->option(['real_name' => '保存通知设置']);
  275. //修改消息状态
  276. Route::put('notification/set_status/:type/:status/:id', 'v1.setting.SystemNotification/set_status')->option(['real_name' => '修改消息状态']);
  277. })->option(['parent' => 'setting', 'cate_name' => '系统通知']);
  278. /** 协议版权 */
  279. Route::group(function () {
  280. //协议设置
  281. Route::get('get_agreement/:type', 'v1.setting.SystemAgreement/getAgreement')->option(['real_name' => '获取协议内容']);
  282. Route::post('save_agreement', 'v1.setting.SystemAgreement/saveAgreement')->option(['real_name' => '设置协议内容']);
  283. //获取版权信息
  284. Route::get('get_version', 'v1.setting.SystemConfig/getVersion')->option(['real_name' => '获取版权信息']);
  285. })->option(['parent' => 'setting', 'cate_name' => '协议版权']);
  286. /** 对外接口 */
  287. Route::group(function () {
  288. //对外接口账号信息
  289. Route::get('system_out_account/index', 'v1.setting.SystemOutAccount/index')->option(['real_name' => '对外接口账号信息']);
  290. //对外接口账号添加
  291. Route::post('system_out_account/save', 'v1.setting.SystemOutAccount/save')->option(['real_name' => '对外接口账号添加']);
  292. //对外接口账号修改
  293. Route::post('system_out_account/update/:id', 'v1.setting.SystemOutAccount/update')->option(['real_name' => '对外接口账号修改']);
  294. //设置账号是否禁用
  295. Route::put('system_out_account/set_status/:id/:status', 'v1.setting.SystemOutAccount/set_status')->option(['real_name' => '设置账号是否禁用']);
  296. //设置账号推送接口
  297. Route::put('system_out_account/set_up/:id', 'v1.setting.SystemOutAccount/outSetUpSave')->option(['real_name' => '设置账号推送接口']);
  298. //删除账号
  299. Route::delete('system_out_account/:id', 'v1.setting.SystemOutAccount/delete')->option(['real_name' => '删除账号']);
  300. //测试获取token接口
  301. Route::post('system_out_account/text_out_url', 'v1.setting.SystemOutAccount/textOutUrl')->option(['real_name' => '测试获取token接口']);
  302. //对外接口列表
  303. Route::get('system_out_interface/list', 'v1.setting.SystemOutAccount/outInterfaceList')->option(['real_name' => '对外接口列表']);
  304. //新增修改对外接口
  305. Route::post('system_out_interface/save/:id', 'v1.setting.SystemOutAccount/saveInterface')->option(['real_name' => '新增修改对外接口']);
  306. //对外接口信息
  307. Route::get('system_out_interface/info/:id', 'v1.setting.SystemOutAccount/interfaceInfo')->option(['real_name' => '对外接口信息']);
  308. //修改接口名称
  309. Route::put('system_out_interface/edit_name', 'v1.setting.SystemOutAccount/editInterfaceName')->option(['real_name' => '修改接口名称']);
  310. //删除接口
  311. Route::delete('system_out_interface/del/:id', 'v1.setting.SystemOutAccount/delInterface')->option(['real_name' => '删除接口']);
  312. })->option(['parent' => 'setting', 'cate_name' => '对外接口']);
  313. /** 多语言 */
  314. Route::group(function () {
  315. //语言国家列表
  316. Route::get('lang_country/list', 'v1.setting.LangCountry/langCountryList')->option(['real_name' => '语言国家列表']);
  317. //添加语言地区表单
  318. Route::get('lang_country/form/:id', 'v1.setting.LangCountry/langCountryForm')->option(['real_name' => '添加语言地区表单']);
  319. //保存语言地区
  320. Route::post('lang_country/save/:id', 'v1.setting.LangCountry/langCountrySave')->option(['real_name' => '保存语言地区']);
  321. //删除语言地区
  322. Route::delete('lang_country/del/:id', 'v1.setting.LangCountry/langCountryDel')->option(['real_name' => '删除语言地区']);
  323. //语言类型列表
  324. Route::get('lang_type/list', 'v1.setting.LangType/langTypeList')->option(['real_name' => '语言类型列表']);
  325. //新增修改语言类型表单
  326. Route::get('lang_type/form/:id', 'v1.setting.LangType/langTypeForm')->option(['real_name' => '新增修改语言类型表单']);
  327. //保存新增修改语言
  328. Route::post('lang_type/save/:id', 'v1.setting.LangType/langTypeSave')->option(['real_name' => '保存新增修改语言']);
  329. //删除语言
  330. Route::delete('lang_type/del/:id', 'v1.setting.LangType/langTypeDel')->option(['real_name' => '删除语言']);
  331. //修改语言类型状态
  332. Route::put('lang_type/status/:id/:status', 'v1.setting.LangType/langTypeStatus')->option(['real_name' => '修改语言类型状态']);
  333. //获取语言列表
  334. Route::get('lang_code/list', 'v1.setting.LangCode/langCodeList')->option(['real_name' => '语言列表']);
  335. //获取语言信息
  336. Route::get('lang_code/info', 'v1.setting.LangCode/langCodeInfo')->option(['real_name' => '语言详情']);
  337. //保存修改语言
  338. Route::post('lang_code/save', 'v1.setting.LangCode/langCodeSave')->option(['real_name' => '保存修改语言']);
  339. //删除语言
  340. Route::delete('lang_code/del/:id', 'v1.setting.LangCode/langCodeDel')->option(['real_name' => '删除语言']);
  341. //机器翻译
  342. Route::post('lang_code/translate', 'v1.setting.LangCode/langCodeTranslate')->option(['real_name' => '机器翻译']);
  343. })->option(['parent' => 'setting', 'cate_name' => '多语言']);
  344. })->middleware([
  345. \app\http\middleware\AllowOriginMiddleware::class,
  346. \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
  347. \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
  348. \app\adminapi\middleware\AdminLogMiddleware::class
  349. ])->option(['mark' => 'setting', 'mark_name' => '系统设置']);