import request from '@/utils/request'

// request.defaults.baseURL = '/ezhizao-yzbh-crm'
// const headUrl = '/ezhizao-yzbh-crm'
// 查询来源列表
export function listSource(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/settings/source/list',
    method: 'get',
    params: query
  })
}

// 查询来源详细
export function getSource(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/settings/source/' + id,
    method: 'get'
  })
}

// 新增来源
export function addSource(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/settings/source',
    method: 'post',
    data: data
  })
}

// 修改来源
export function updateSource(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/settings/source',
    method: 'put',
    data: data
  })
}

// 删除来源
export function delSource(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/settings/source/' + id,
    method: 'delete'
  })
}
