"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setLoginUser = exports.getLoginUser = void 0;
const crypt_1 = require("./crypt");
const KEY = 'FOXPAGE.USER';
const getLoginUser = () => {
    try {
        const cachedStr = localStorage.getItem(KEY);
        const userInfo = cachedStr ? JSON.parse((0, crypt_1.decrypt)(cachedStr)) : {};
        return userInfo;
    }
    catch (error) {
        console.error(error);
        return {};
    }
};
exports.getLoginUser = getLoginUser;
const setLoginUser = (userInfo) => {
    try {
        localStorage.setItem(KEY, (0, crypt_1.encrypt)(JSON.stringify(userInfo || {})));
    }
    catch (error) {
        console.error(error);
    }
};
exports.setLoginUser = setLoginUser;
