import request from '@/utils/request'

// 获取资源树

export function resourcesTree() {
  return request({
    url: `/csc-szls-system-manage/resource/authority/getAll`,
    method: 'post'

  })
}

// 资源数回显
export function editResourcesTree(params) {
  return request({
    url: `/csc-szls-system-manage/role/authority/getByColeId`,
    method: 'get',
    params
  })
}

// 获取列表
export function getUserInfo(data) {
  return request({
    url: `/csc-szls-system-manage/role/authority/getPage`,
    method: 'post',
    data
  })
}

// 新增用户
export function addUserInfo(data) {
  return request({
    url: `/csc-szls-system-manage/role/authority_button/add`,
    method: 'post',
    data
  })
}

// 删除用户
export function deleteUserInfo(params) {
  return request({
    url: `/csc-szls-system-manage/role/authority_button/deleteById`,
    method: 'delete',
    params
  })
}

// 修改用户

export function updateUserInfo(data) {
  return request({
    url: `/csc-szls-system-manage/role/authority_button/update`,
    method: 'post',
    data
  })
}

// 查看用户
export function checkUserInfo(id) {
  return request({
    url: `/csc-szls-system-manage/role/authority/getById/${id}`,
    method: 'get'

  })
}

// 查看角色是否存在
export function roleIsExit(params) {
  return request({
    url: `/csc-szls-system-manage/role/authority_button/getByRoleName`,
    method: 'get',
    params
  })
}

export function loadResourceDefine() {
  return request({
    url: `/csc-szls-system-manage/public/loadResourceDefine`,
    method: 'get',
  })
}

