{"size": 799, "ext": "js", "max_stars_repo_path": "src/api/permission.js", "max_stars_repo_name": "wmsweb/vue-element-admin", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/api/permission.js", "max_issues_repo_name": "wmsweb/vue-element-admin", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/api/permission.js", "max_forks_repo_name": "wmsweb/vue-element-admin", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 16.6458333333, "max_line_length": 41, "alphanum_fraction": 0.6307884856}
import request from '@/utils/request'

export function permissionTree() {
  return request({
    url: '/permission/list',
    method: 'get'
  })
}

export function rolePermission(roleId) {
  return request({
    url: '/permission/role',
    method: 'get',
    params: { roleId }
  })
}

export function addRolePermission(data) {
  return request({
    url: '/permission/addRolePermission',
    method: 'post',
    data
  })
}

export function addPermission(data) {
  return request({
    url: '/permission/add',
    method: 'post',
    data
  })
}

export function deletePermission(id) {
  return request({
    url: `/permission/delete/${id}`,
    method: 'delete'
  })
}

export function updatePermission(data) {
  return request({
    url: '/permission/update',
    method: 'put',
    data
  })
}
