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

const api = {
  fcenterUserInfo: '/backmanage/centerUser'
}



// 修改时根据用户名和用户ID进行重复用户名校验
export function getUsernameCountByUsername (parameter) {
  return axios({
    url: api.fcenterUserInfo + '/getUsernameCountByUsername',
    method: 'get',
    params: parameter
  })
}


// 新增时根据用户名进行重复用户名校验
export function getUsernameCountByUsernameToInsert (parameter) {
  return axios({
    url: api.fcenterUserInfo + '/getUsernameCountByUsernameToInsert',
    method: 'get',
    params: parameter
  })
}



export function getFcenterUserInfoList (parameter) {
  return axios({
    url: api.fcenterUserInfo + '/list',
    method: 'get',
    params: parameter
  })
}

export function saveFcenterUserInfo (parameter) {
  console.log("-=0-0--0-0-0=-=-=-=-=-=-=-=")
  console.log(parameter)
  console.log("-=0-0--0-0-0=-=-=-=-=-=-=-=")
  return axios({
    url: api.fcenterUserInfo + (parameter.id === 0 ? '/save' : '/update'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delFcenterUserInfo (parameter) {
  return axios({
    url: api.fcenterUserInfo + '/remove',
    method: 'post',
    params: parameter
  })
}

export const fcenterUserInfoExport = api.fcenterUserInfo + '/export'
