menu.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. import service from '@/utils/request'
  2. // @Summary 用户登录 获取动态路由
  3. // @Produce application/json
  4. // @Param 可以什么都不填 调一下即可
  5. // @Router /menu/getMenu [post]
  6. export const asyncMenu = () => {
  7. return service({
  8. url: '/menu/getMenu',
  9. method: 'post'
  10. })
  11. }
  12. // @Summary 获取menu列表
  13. // @Produce application/json
  14. // @Param {
  15. // page int
  16. // pageSize int
  17. // }
  18. // @Router /menu/getMenuList [post]
  19. export const getMenuList = (data) => {
  20. return service({
  21. url: '/menu/getMenuList',
  22. method: 'post',
  23. data
  24. })
  25. }
  26. // @Summary 新增基础menu
  27. // @Produce application/json
  28. // @Param menu Object
  29. // @Router /menu/getMenuList [post]
  30. export const addBaseMenu = (data) => {
  31. return service({
  32. url: '/menu/addBaseMenu',
  33. method: 'post',
  34. data
  35. })
  36. }
  37. // @Summary 获取基础路由列表
  38. // @Produce application/json
  39. // @Param 可以什么都不填 调一下即可
  40. // @Router /menu/getBaseMenuTree [post]
  41. export const getBaseMenuTree = () => {
  42. return service({
  43. url: '/menu/getBaseMenuTree',
  44. method: 'post'
  45. })
  46. }
  47. // @Summary 添加用户menu关联关系
  48. // @Produce application/json
  49. // @Param menus Object authorityId string
  50. // @Router /menu/getMenuList [post]
  51. export const addMenuAuthority = (data) => {
  52. return service({
  53. url: '/menu/addMenuAuthority',
  54. method: 'post',
  55. data
  56. })
  57. }
  58. // @Summary 获取用户menu关联关系
  59. // @Produce application/json
  60. // @Param authorityId string
  61. // @Router /menu/getMenuAuthority [post]
  62. export const getMenuAuthority = (data) => {
  63. return service({
  64. url: '/menu/getMenuAuthority',
  65. method: 'post',
  66. data
  67. })
  68. }
  69. // @Summary 获取用户menu关联关系
  70. // @Produce application/json
  71. // @Param ID float64
  72. // @Router /menu/deleteBaseMenu [post]
  73. export const deleteBaseMenu = (data) => {
  74. return service({
  75. url: '/menu/deleteBaseMenu',
  76. method: 'post',
  77. data
  78. })
  79. }
  80. // @Summary 修改menu列表
  81. // @Produce application/json
  82. // @Param menu Object
  83. // @Router /menu/updateBaseMenu [post]
  84. export const updateBaseMenu = (data) => {
  85. return service({
  86. url: '/menu/updateBaseMenu',
  87. method: 'post',
  88. data
  89. })
  90. }
  91. // @Tags menu
  92. // @Summary 根据id获取菜单
  93. // @Security ApiKeyAuth
  94. // @accept application/json
  95. // @Produce application/json
  96. // @Param data body api.GetById true "根据id获取菜单"
  97. // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
  98. // @Router /menu/getBaseMenuById [post]
  99. export const getBaseMenuById = (data) => {
  100. return service({
  101. url: '/menu/getBaseMenuById',
  102. method: 'post',
  103. data
  104. })
  105. }