import request from '@/utils/request'

// 获取所有的菜单树
export function getMenusTree(data) {
  return request({
    url: '/admin/rbac/menu/list',
    method: 'post',
    data
  })
}

export function buildMenus(data) {
  return request({
    url: '/admin/rbac/menu/listByUser',
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: '/admin/rbac/menu/save',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    url: `/admin/rbac/menu/delete`,
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: '/admin/rbac/menu/update',
    method: 'post',
    data
  })
}
