//缓存浏览器数据
var StorageMessage = {
    getStorage : function(key){
        var result = null;
        if(cc.sys.localStorage.getItem(key)){
          var result = cc.sys.localStorage.getItem(key);
        }
        
        if(result){
          result = JSON.parse(result);
        }
        return result;
    },
    setStorage : function(key,value){
        //主动拉起分享接口
        var temp = JSON.stringify(value);
        cc.sys.localStorage.setItem(key, temp)
    },
    removeStorage : function(key){
      //主动删除消息接口
      if(cc.sys.localStorage.getItem(key)){
        cc.sys.localStorage.removeItem(key)
      }
    },
};

export { StorageMessage };