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() {
  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))
}


export function getStorageMenu() {
  return window.sessionStorage.getItem('fp_menu') ? JSON.parse(window.sessionStorage.getItem('fp_menu')) : []
}
export function setStorageMenu(data) {
  return window.sessionStorage.setItem('fp_menu', JSON.stringify(data))
}


export function getNotify() {
  return window.sessionStorage.getItem('fp_notify') ? JSON.parse(window.sessionStorage.getItem('fp_notify')) : {}
}
export function setNotify(data) {
  return window.sessionStorage.setItem('fp_notify', JSON.stringify(data))
}

export function setLoginPhone(data) {
  return window.localStorage.setItem('fp_login_phone', data)
}
export function setLoginPwd(data) {
  return window.localStorage.setItem('fp_login_pwd', data)
}
export function removeLoginPwd() {
  return window.localStorage.removeItem('fp_login_pwd')
}