import http from '@/utils/request'

// 获取角色列表
export function getRoleList (params) {
  return http.post('/tenant/role', { data: params })
}

// 获取权限列表
export function getPermissionList () {
  return http.post('/tenant/resource')
}

// 添加角色
export function addRole (params) {
  return http.post('/tenant/role/add', { data: params })
}

// 更新角色
export function editRole (params) {
  return http.post('/tenant/role/update', { data: params })
}

// 删除角色
export function delRole (id) {
  const params = {
    idList: [id]
  }
  return http.post('/tenant/role/delete', { data: params })
}

// 获取资源权限列表
export function getResourceList () {
  return http.post('/tenant/resource')
}

export function getResourceTreeList () {
  return http.post('/tenant/resource/treeList')
}
