import http from "@/util/http.js";

// 角色管理页面请求
export function roleList() {
  return http({
    url: "/api/roles",
    method: "get",
  });
}

// 角色新增请求
export function roleAdd(data) {
  return http({
    url: "/api/roles",
    method: "post",
    data,
  });
}

// 角色权限列表请求
export function jurisdiction() {
  return http({
    url: "/api/permissions",
    method: "get",
  });
}

// 角色权限编辑
export function jurisdictionEdit(id, data) {
  return http({
    url: `/api/roles/${id}/permissions`,
    method: "post",
    data,
  });
}
