role.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import http from '@/http/api.js'
  2. // 角色管理
  3. export const getList = (params) => {
  4. return http.request({
  5. url: '/api/blade-system/role/list',
  6. method: 'GET',
  7. params
  8. })
  9. }
  10. export const remove = (ids) => {
  11. return http.request({
  12. url: '/api/blade-system/role/remove',
  13. method: 'post',
  14. params: {
  15. ids,
  16. }
  17. })
  18. }
  19. export const add = (row) => {
  20. return http.request({
  21. url: '/api/blade-system/role/submit',
  22. method: 'post',
  23. data: row
  24. })
  25. }
  26. export const update = (row) => {
  27. return http.request({
  28. url: '/api/blade-system/role/submit',
  29. method: 'post',
  30. data: row
  31. })
  32. }
  33. export const roleTree = (params) => {
  34. return http.request({
  35. url: '/api/blade-system/role/tree-by-id',
  36. method: 'GET',
  37. params
  38. })
  39. }
  40. export const menuTree = (params) => {
  41. return http.request({
  42. url: '/api/blade-system/menu/grant-tree',
  43. method: 'GET',
  44. params
  45. })
  46. }
  47. export const menuTreeKey = (params) => {
  48. return http.request({
  49. url: '/api/blade-system/menu/role-tree-keys',
  50. method: 'GET',
  51. params
  52. })
  53. }
  54. export const grant = (data) => {
  55. return http.request({
  56. url: '/api/blade-system/role/grant',
  57. method: 'post',
  58. data,
  59. })
  60. }