import http from '@/utils/request'

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

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

// 获取权限列表-tree
export function getPermissionTree () {
  return http.post('/admin/resource/treeList')
}

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

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

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