import request from './request';

//查询省
export const  getProvince = () => {
  return request({
    url: `area/PROVINCE`,
    method: 'get'
  })
}
//查询市
export const  getCityByPro = params => {
  return request({
    url: `area/CITY/${params.id}`,
    method: 'get'
  })
}
//查询区
export const  getDistrictByCity = params => {
  return request({
    url: `area/DISTRICT/${params.id}`,
    method: 'get'
  })
}

// 查询用户头像和昵称是否已存在
export const findWxUserInfo = (params) => {
  return request({
    url: `wxuser/findWxUserInfo`,
    method: 'post',
	data:params
  }).then(res=>res.data)
}

// 更新用户头像和昵称信息
export const wxUserUpdate = (params) => {
  return request({
    url: `wxuser/update`,
    method: 'post',
	data:params
  }).then(res=>res.data)
}
// 获取用户信息
export const getCurrUserInfo = (params) => {
  return request({
    url: 'employee/findCurrent',
	data:params,
    method: 'get'
  })
}

// 根据字典code查询选项
export const getLookUpDatas = (params) => {
  return request({
    url: `lookup/findByLookup/${params.type}`,
    method: 'get'
  })
}
// 根据字典code查询所有数据
export const getAllLookUpDatas = (params) => {
  return request({
    url: `lookup/findAllByLookup/${params.type}`,
    method: 'get'
  })
}
// 查询所有数据字典
export const listLookUp = (params) => {
  let url = `lookup/findAll`
  return request({
    url: url,
    method: 'post'
  })
}