import Cookies from 'js-cookie'

const TokenKey = 'token'
const PublicKey = 'public_key'
const Seat = 'seat'
const Exten = 'exten'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getPublicKey() {
  return window.localStorage.getItem(PublicKey)
}

export function setPublicKey(publicKey) {
  return window.localStorage.setItem(PublicKey, publicKey)
}

export function removePublicKey() {
  return window.localStorage.removeItem(PublicKey)
}
// 保存坐席号
export function getSeat() {
  return Cookies.get(Seat)
}

export function setSeat(seat) {
  return Cookies.set(Seat, seat)
}

export function removeSeat() {
  return Cookies.remove(Seat)
}

// 保存分机号
export function getExten() {
  return Cookies.get(Exten)
}

export function setExten(exten) {
  return Cookies.set(Exten, exten)
}

export function removeExten() {
  return Cookies.remove(Exten)
}
// 座席签入状态
export function getOnline() {
  return window.localStorage.getItem('online')
}

export function setOnline(online) {
  return window.localStorage.setItem('online', online)
}

export function removeOnline() {
  return window.localStorage.removeItem('online')
}
