import request from '@/utils/request'
import axios from 'axios/index'
export function loginByUsername(username, password) {
  const data = {
    tel: username,
    password: password
  }
  return request('post','/api/login', data)
}

export function get_point_types() {
  return request('get','/api/integral/types',)
}
export function loginByDemo() {
  return request('post','/api/system/try-out',)
}
export function get_employee_map() {
  return request('get','/api/employee/list',)
}

export function get_site_info() {
  return request('get','/api/site/info',)
}

export function get_dept_tree() {
  return request('get','/api/department/tree',)
}

export function getUserInfo(token) {
  var instance = axios.create({
    baseURL: process.env.BASE_API,
    timeout: 10000 // request timeout
  })
  instance.defaults.headers.common['A-TOKEN'] = token
  return instance({
    url: '/api/employee/detail',
    method: 'get'
  })
}

