{"size": 1629, "ext": "js", "max_stars_repo_path": "src/api/role.js", "max_stars_repo_name": "javawww/buddha-bigcat-web", "max_stars_repo_stars_event_min_datetime": "2019-06-19T08:11:44.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-14T03:22:59.000Z", "max_issues_repo_path": "src/api/role.js", "max_issues_repo_name": "javawww/buddha-bigcat-web", "max_issues_repo_issues_event_min_datetime": "2021-01-05T09:15:11.000Z", "max_issues_repo_issues_event_max_datetime": "2021-01-05T09:15:11.000Z", "max_forks_repo_path": "src/api/role.js", "max_forks_repo_name": "javawww/buddha-bigcat-web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 17.5161290323, "max_line_length": 51, "alphanum_fraction": 0.569674647}
import request from '@/utils/request'

export function getRoutes() {
  // return request({
  //   url: '/routes',
  //   method: 'get'
  // })
  return request({
    url: '/miracle-api/admin-resource/roleResTree',
    method: 'post'
  })
}

export function getRoutes2() {
  // return request({
  //   url: '/routes',
  //   method: 'get'
  // })
  return request({
    url: '/miracle-api/admin-resource/resTree',
    method: 'post'
  })
}

export function getRoles(data) {
  // return request({
  //   url: '/roles',
  //   method: 'get'
  // })
  return request({
    url: '/miracle-api/systemRoles/list',
    method: 'post',
    data
  })
}

// 新增角色
export function addRole(data) {
  // return request({
  //   url: '/role',
  //   method: 'post',
  //   data
  // })
  return request({
    url: '/miracle-api/systemRoles/save',
    method: 'post',
    data
  })
}
// 更新角色
export function updateRole(data) {
  // return request({
  //   url: `/role/${id}`,
  //   method: 'put',
  //   data
  // })
  return request({
    url: '/miracle-api/systemRoles/update',
    method: 'post',
    data
  })
}
// 删除角色
export function deleteRole(data) {
  // return request({
  //   url: `/role/${id}`,
  //   method: 'delete'
  // })
  return request({
    url: '/miracle-api/systemRoles/del',
    method: 'post',
    data
  })
}

// 获取该角色选中的资源id
export function checkedResArr(data) {
  return request({
    url: '/miracle-api/systemRoles/checkedResArr',
    method: 'post',
    data
  })
}

// 角色下拉框
export function selectOptions(data) {
  return request({
    url: '/miracle-api/systemRoles/options',
    method: 'post',
    data
  })
}
