import http from '@/utils/request'

export function login (data) {
  return http.post('/system/auth/login', data)
}

// 用户列表
export function getUserList (data) {
  return http.post('/authentication/user/list', data)
}

// 用户详情
export function getUserDetails (data) {
  return http.post('/authentication/user/detail', data)
}

// 保存用户
export function saveUser (data) {
  return http.post('/authentication/user/save', data)
}

// 删除用户
export function deleteUser (data) {
  return http.post('/authentication/user/del', data)
}

// 用户字典
// export function getUserDiction (data) {
//   return http.post('/authentication/dictionaries/list/tenant', data)
// }

// 修改重置密码
export function resetPassword (params) {
  return http.post('/authentication/user/resetpwd', params)
}

// 上传文件
export function uploadFile (path, file) {
  const form = new FormData()
  form.append('path', path)
  form.append('file', file)
  return http.upload('/authentication/document/file/upload', form)
}

// 下载用户列表
export function downloadUserTemplate () {
  return http.post('/authentication/user/gz/icbc/excel/dowan')
}

// 批量导入用户
export function userExcelExport (params) {
  return http.upload('/authentication/user/gz/icbc/excel/export', params)
}
