如何在流星上的不同浏览器/选项卡/窗口上区分同一用户? [英] how to differentiate the same user on different browser/tab/windows on meteor?

查看:38
本文介绍了如何在流星上的不同浏览器/选项卡/窗口上区分同一用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想象一下,我有一个用户在 2 个不同的浏览器选项卡、2 个不同的浏览器或 2 台不同的计算机上连接流星应用程序.

Imagine, I have a user that connects on a meteor app on 2 different browser tabs, or 2 different browsers, or 2 different computer.

我的应用需要使用唯一的 ID(用户 ID+???)来区分.

My app needs to distinguish that with a unique id (userid+???).

我可以用什么来识别客户端和服务器上的这一点?

What can I use to identify this on the client and on the server?

一个用例是,例如,用户锁定一个字段以便能够对其进行编辑,我们不希望其他任何人对其进行编辑,即使它是另一个选项卡/Windows/浏览器/计算机上的同一用户.

A use case is for example, a user locks a field to be able to edit it, we don't want anybody else to edit it even if it's the same user on another tab/windows/browser/computer.

推荐答案

类似:

Meteor.startup(function () {
    window.uniqueUser = Meteor.uuid();
});

这篇关于如何在流星上的不同浏览器/选项卡/窗口上区分同一用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆