import { request } from 'umi';
//分页
export async function Page(params) {
  return request('/kitchen/api/role/page', {
    method: 'post',
    data: {
      ...params,
    },
  });
}
//启用
export async function Enable(params) {
  return request(`/kitchen/api/role/enable/?Id=${params}`);
}
//禁用
export async function Disable(params) {
  return request(`/kitchen/api/role/disable/?Id=${params}`);
}

//新增
export async function add(params) {
  return request('/kitchen/api/role/add', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
//修改
export async function edit(params) {
  return request('/kitchen/api​/role/update', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
//删除
export async function removeRole(params) {
  return request('/kitchen/api​/role/delete', {
    method: 'POST',
    data: params,
  });
}

//设置菜单
export async function setMenu(params) {
  return request('​/kitchen/api/role/addorupdatemenurole',{
    method:'post',
    data:params
  });
}

//获取角色菜单
export async function GetRoleMenu(params) {
  return request(`/kitchen/api/role/getmenurole/?RoleId=${params}`);
}

//数据授权
export async function SetDataRole(params) {
  return request(`/kitchen/api/role/setandalterdatascope`,{
    method:'post',
    data:params
  });
}
