authority.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import service from '@/utils/request'
  2. // @Router /authority/getAuthorityList [post]
  3. export const getAuthorityList = (data) => {
  4. return service({
  5. url: '/authority/getAuthorityList',
  6. method: 'post',
  7. data
  8. })
  9. }
  10. // @Summary 删除角色
  11. // @Security ApiKeyAuth
  12. // @accept application/json
  13. // @Produce application/json
  14. // @Param data body {authorityId uint} true "删除角色"
  15. // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
  16. // @Router /authority/deleteAuthority [post]
  17. export const deleteAuthority = (data) => {
  18. return service({
  19. url: '/authority/deleteAuthority',
  20. method: 'post',
  21. data
  22. })
  23. }
  24. // @Summary 创建角色
  25. // @Security ApiKeyAuth
  26. // @accept application/json
  27. // @Produce application/json
  28. // @Param data body api.CreateAuthorityPatams true "创建角色"
  29. // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
  30. // @Router /authority/createAuthority [post]
  31. export const createAuthority = (data) => {
  32. return service({
  33. url: '/authority/createAuthority',
  34. method: 'post',
  35. data
  36. })
  37. }
  38. // @Tags authority
  39. // @Summary 拷贝角色
  40. // @Security ApiKeyAuth
  41. // @accept application/json
  42. // @Produce application/json
  43. // @Param data body api.CreateAuthorityPatams true "拷贝角色"
  44. // @Success 200 {string} json "{"success":true,"data":{},"msg":"拷贝成功"}"
  45. // @Router /authority/copyAuthority [post]
  46. export const copyAuthority = (data) => {
  47. return service({
  48. url: '/authority/copyAuthority',
  49. method: 'post',
  50. data
  51. })
  52. }
  53. // @Summary 设置角色资源权限
  54. // @Security ApiKeyAuth
  55. // @accept application/json
  56. // @Produce application/json
  57. // @Param data body sysModel.SysAuthority true "设置角色资源权限"
  58. // @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
  59. // @Router /authority/setDataAuthority [post]
  60. export const setDataAuthority = (data) => {
  61. return service({
  62. url: '/authority/setDataAuthority',
  63. method: 'post',
  64. data
  65. })
  66. }
  67. // @Summary 修改角色
  68. // @Security ApiKeyAuth
  69. // @accept application/json
  70. // @Produce application/json
  71. // @Param data body model.SysAuthority true "修改角色"
  72. // @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
  73. // @Router /authority/setDataAuthority [post]
  74. export const updateAuthority = (data) => {
  75. return service({
  76. url: '/authority/updateAuthority',
  77. method: 'put',
  78. data
  79. })
  80. }