import axios from 'axios'
const Store = require('electron-store')
const localStore = new Store()

const http = axios.create({
  baseURL: localStore.get('idDeviceUrl') || 'http://127.0.0.1:19196', // api的base_url
  timeout: 5000 // 请求超时时间
})

export function openDevice () {
  return http.post('/OpenDevice')
}

export function readcard () {
  return http.post('/readcard')
}

export function closeDevice () {
  return http.post('/CloseDevice')
}
