import { request } from 'umi';

export async function queryUser(params) {
  return request('/kitchen/api/sysUser/page', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function removeRule(params) {
  return request('/kitchen/api/rule', {
    method: 'POST',
    data: {
      ...params,
      method: 'delete',
    },
  });
}

export async function addUser(params) {
  return request('/kitchen/api/sysUser/add', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function updateUser(params) {
  return request('/kitchen/api/sysUser/add', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function setRoles(params) {
  return request(`/kitchen/api/sysUser/grantRole`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
export async function sysUserGrantData(params) {
  return request(`/kitchen/api/sysUser/grantData`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
