import request from "../../utils/request";
import qs from "qs";
let setqs = function (data) {
  return qs.stringify(data);
};

// 获取用户列表
export function getUserListApi (data) {
  console.log(data);
  return request({
    url: `/admin/user/${data.page}/${data.limit}?keyword=${data.keyword}`,
    method: "get",
  });
}

// 用户状态变更
export function updateUserStatusApi (data) {
  return request({
    url: `/admin/user/updateStatus/${data.id}/${data.status}`,
    method: "get",
  });
}

// 新增用户
export function addUserApi (data) {
  return request({
    url: `/admin/user/save`,
    method: "post",
    data
  });
}
// 删除用户
export function delUserApi (data) {
  return request({
    url: `/admin/user/remove/${data}`,
    method: "DELETE",
  });
}
