import localStronge from '../service/localStronge.js'
import { Base64 } from 'js-base64'

const localData = {
  setUser(value) {
    localStronge.set('user', value)
  },
  getUser() {
    return localStronge.get('user')
  },
  setPassword(value) {
    localStronge.set('password', Base64.encode(value))
  },
  getPassword() {
    return Base64.decode(localStronge.get('password'))
  },
  setLogin(value) {
    localStronge.set('login', value)
  },
  getLogin() {
    return localStronge.get('login')
  },
  setServiceip(value) {
    localStronge.set('service', value)
  },
  getServiceip() {
    return localStronge.get('service')
  },
  setToken(value) {
    sessionStorage.setItem('token', value)
  },
  getToken() {
    return sessionStorage.getItem('token')
  },
  setMenus(value) {
    localStronge.set('menu', value)
  },
  getMenus() {
    return localStronge.get('menu')
  }
}

export default localData
