Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
名为“user1”的用户在计算机 a 上登录。然后在另一台计算机b上,帐户'user1'无法登录,user1必须注销,然后user1才能在计算机b上登录。
设计支持吗?
您可以在用户表中添加列,这将指示用户是否登录。用户登录时设置为真,注销时设置为假。在用户登录时检查此列是否为假,然后登录您的用户,否则显示一些通知,而不是使用此帐户的其他人。
为避免用户在未注销的情况下关闭选项卡的情况,请制作 rake 任务,该任务将在一段时间后注销用户
UPD:正如@Arjan 所说,您甚至不需要 rake 任务,您可以为此使用设计的模块