import request, { apiGet } from '@/utils/request';

// 获取角色列表
export function getRoseList() {
  return request({
    url: '/api/get_role_list',
    method: 'get'
  });
}

// 添加用户
export function addUserApi(data) {
  return request({
    url: '/api/add_user',
    method: 'post',
    data
  });
}

// 获取用户列表
export function getUserList(data) {
  return request({
    url: '/api/user_list',
    method: 'post',
    data
  });
}

//编辑用户
export function editUserApi(role_id, data) {
  return request({
    url: `api/${role_id}`,
    method: 'put',
    data
  });
}

// 删除用户
export function deleteUserApi(role_id) {
  return request({
    url: `api/delete_user/${role_id}`,
    method: 'delete'
  });
}

// 关机
export function shutDownApi() {
  return request({
    url: `/api/shut_down`,
    method: 'get'
  });
}

export function exitServiceApi() {
  return request({
    url: `/api/exit`,
    method: 'get'
  });
}

//重置修改密码
export function resetPwd(data) {
  return request({
    url: '/api/updateUserPassword',
    method: 'post',
    data
  });
}

export function userLogin(data) {
  return request({
    url: '/api/userfaceLogin',
    method: 'get',
    params: data
  });
}
