const TokenKey = 'fp_token'

export function getToken() {
  return window.sessionStorage.getItem(TokenKey)
}
export function setToken(token) {
  return window.sessionStorage.setItem(TokenKey, token)
}
export function removeToken() {
  return window.sessionStorage.removeItem(TokenKey)
}

export function getStorageDict() {
  return window.sessionStorage.getItem('fp_dictData') ? JSON.parse(window.sessionStorage.getItem('fp_dictData')) : {}
}
export function setStorageDict(data) {
  return window.sessionStorage.setItem('fp_dictData', JSON.stringify(data))
}

export function getStorageUser(data) {
  return window.sessionStorage.getItem('fp_user') ? JSON.parse(window.sessionStorage.getItem('fp_user')) : {}
}
export function setStorageUser(data) {
  return window.sessionStorage.setItem('fp_user', JSON.stringify(data))
}
