import popup from "$utils/tool/popup";
import {PopupExportComponent} from "$popup/popup-export/const";

export default {

    // 默认缓存多久
    storageTime: -1,

    // 用户信息
    user:undefined,

    // 缓存的key
    storageKey:'user',

    // 校验唯一值
    stringify:'',

    // 是否登录
    isLogin(){
        return this.user && this.user.login_token;
    },

    // 获取用户id
    uid(){
      return this.user && this.user.uid;
    },

    // 校验登录
    verificationLogin(){

        let result = this.isLogin();

        if (!result) {
            popup.$popup && popup.$popup.open(PopupExportComponent.login);
        }

        return result;

    }


}