import { axios } from '@/utils/request'

// 重置密码
export const resetPSD = params => {
  return axios({
    url: '/yyuser/resetPwd',
    data: params,
    method: 'POST',
    headers:{
        'module': encodeURIComponent('重置密码')
    }
  })
}

// 获取列表数据
export const getPowerUserList = params => {
  const url = `/ocsuser/queryLikePage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'POST',
    headers:{
        'module': encodeURIComponent('列表查询')
    }
  })
}

// 改变权限状态接口
export const updateEnableStatus = params => {
  return axios({
    url: `/yyuser/enable/${params.id}/${params.flag}`,
    data: {},
    method: 'get',
    headers:{
        'module': encodeURIComponent('启用禁用')
    }
  })
}

// 删除用户接口
export const delectUserPower = params => {
  return axios({
    url: `/yyuser/delete/${params.id}`,
    data: {},
    method: 'get',
    headers:{
        'module': encodeURIComponent('删除')
    }
  })
}

// 新增/编辑保存接口
export const saveUserPower = params => {
  return axios({
    url: '/yyuser/save',
    data: params,
    method: 'POST',
    headers:{
        'module': encodeURIComponent('新增/编辑')
    }
  })
}

// 获取角色列表接口
export const getRoleList = params => {
  return axios({
    url: '/yyrole/findAll',
    data: params,
    method: 'POST',
    headers:{
        'module': encodeURIComponent('角色列表')
    }
  })
}
// 用户管理   分区设置
export const userSubareaSave = params => {
  return axios({
    url: '/userSubarea/save',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('分区设置')
    }
  })
}
// 所有用户
export const userQueryList = params => {
  return axios({
    url: '/yyuser/queryAllLike',
    data: params,
    method: 'POST',
    headers:{
        'module': encodeURIComponent('用户列表')
    }
  })
}
