import request from '@/utils/request'

// 超级管理员登录
export const userLoginService = ({ account, passwd }) => {
  return request.post('/user/admin', { account, passwd })
}

// 获取用户列表
export const userListService = (data) => request.post('/user/list', data)

// 查看用户的详细信息
export const userDetailService = (id) => request.get('/user/detail?id=' + id)

// 获取用户的数量
export const userNum = () => request.get('/user/num')

// 充值
export const userRechargeService = (formData) =>
  request.post('/user/recharge', formData)

// 获取管理员列表
export const adminListService = (data) => request.post('/user/admininfo', data)

// 添加管理员信息
export const adminAddService = (data) => request.post('/user/create', data)

// 移除管理员信息
export const adminDelService = (id) => request.get('/user/remove?userId=' + id)

// 修改密码
export const PasswdService = (data) => request.post('/user/passwd', data)

// 获取用户信息
export const UserInfoService = (id) => request.get(`/user/info/${id}`)

// 上传头像图片
export const ImgUploadService = (formData) =>
  request.post('/user/upload', formData)

// 修改用户信息
export const UpdateService = (data) => request.post('/user/update', data)

// qq邮箱重置
export const ResetService = (data) => request.post('/user/reset', data)
