import Cookies from 'js-cookie'

import { MyLocalStorage } from '@/assets/js/utils'
import { USER_ACCOUNT, USER_PWD, TOKEN, PUBLIC_KEY, ClIENT_ID, NAME, DEPT_NAME, DEPT_ID, PHONE } from 'assets/js/storageConst'
//关于token
export function getToken() {
  return MyLocalStorage.Cache.get(TOKEN)
}

export function setToken(token) {
  return MyLocalStorage.Cache.set(TOKEN, token,99999)
}

export function removeToken() {
  return MyLocalStorage.Cache.remove(TOKEN)
}
//关于公钥
export function getPublicKey() {
  return MyLocalStorage.Cache.get(PUBLIC_KEY)
}

export function setPublicKey(publicKey) {
  return MyLocalStorage.Cache.set(PUBLIC_KEY, publicKey, 99999)
}

export function removePublicKey() {
  return MyLocalStorage.Cache.remove(PUBLIC_KEY)
}
//关于用户名
export function getAccount() {
  return MyLocalStorage.Cache.get(USER_ACCOUNT,99999)
}

export function setAccount(username) {
  return MyLocalStorage.Cache.set(USER_ACCOUNT, username)
}

export function removeAccount() {
  return MyLocalStorage.Cache.remove(USER_ACCOUNT)
}
//关于密码
export function getPwd() {
  return MyLocalStorage.Cache.get(USER_PWD)
}

export function setPwd(pwd) {
  return MyLocalStorage.Cache.set(USER_PWD, pwd,99999)
}

export function removePwd() {
  return MyLocalStorage.Cache.remove(USER_PWD)
}

//关于cid
export function getCid() {
  return MyLocalStorage.Cache.get(ClIENT_ID)
}

export function setCid(cid) {
  return MyLocalStorage.Cache.set(ClIENT_ID, cid,99999)
}

export function removeCid() {
  return MyLocalStorage.Cache.remove(ClIENT_ID)
}
//关于用户姓名
export function getName() {
  return MyLocalStorage.Cache.get(NAME)
}

export function setName(name) {
  return MyLocalStorage.Cache.set(NAME, name,99999)
}

export function removeName() {
  return MyLocalStorage.Cache.remove(NAME)
}
//关于部门
export function getDeptName() {
  return MyLocalStorage.Cache.get(DEPT_NAME)
}

export function setDeptName(deptName) {
  return MyLocalStorage.Cache.set(DEPT_NAME, deptName,99999)
}

export function removeDeptName() {
  return MyLocalStorage.Cache.remove(DEPT_NAME)
}
export function getDeptId() {
  return MyLocalStorage.Cache.get(DEPT_ID)
}

export function setDeptId(deptId) {
  return MyLocalStorage.Cache.set(DEPT_ID, deptId, 99999)
}

export function removeDeptId() {
  return MyLocalStorage.Cache.remove(DEPT_ID)
}
//关于phone
export function getPhone() {
  return MyLocalStorage.Cache.get(PHONE)
}

export function setPhone(phone) {
  return MyLocalStorage.Cache.set(PHONE, phone,99999)
}

export function removePhone() {
  return MyLocalStorage.Cache.remove(PHONE)
}

