"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _default = {
  // setSysParams(data) {
  //   localStorage.setItem('eshop_sysparams', typeof data === 'string' ? data : JSON.stringify(data));
  // },
  // getSysParams() {
  //   let result;
  //   try {
  //     result = JSON.parse(localStorage.getItem('eshop_sysparams')) || [];
  //   } catch (e) {
  //     result = [];
  //   }
  //   return result;
  // },
  // getSysParamsByCode(code) {
  //   const data = this.getSysParams() || [];
  //   const params = data.filter(param => param.paramCode === code);
  //   if (!isEmpty(params)) {
  //     return params[0].paramValue;
  //   }
  //   return '';
  // },
  setUserInfo: function setUserInfo(data) {
    localStorage.setItem('eshop_userinfo', typeof data === 'string' ? data : JSON.stringify(data));
  },
  getUserInfo: function getUserInfo() {
    var result;

    try {
      result = JSON.parse(localStorage.getItem('eshop_userinfo')) || {};
    } catch (e) {
      result = [];
    }

    return result;
  },
  getUser: function getUser() {
    var currentUser;

    try {
      currentUser = JSON.parse(localStorage.getItem('currentUser')) || {};
    } catch (e) {
      currentUser = {};
    }

    return currentUser;
  },
  getIsLogin: function getIsLogin() {
    var isLogin = localStorage.getItem('isLogin');
    return isLogin === 'Y';
  },
  saveUser: function saveUser(user) {
    localStorage.setItem('currentUser', JSON.stringify(user));
    localStorage.setItem('isLogin', 'Y');
  },
  signOut: function signOut() {
    localStorage.removeItem('currentUser');
    localStorage.removeItem('isLogin');
  }
};
exports["default"] = _default;