机器人腿 注销
我正在构建一个 Robotlegs 应用程序,您必须登录才能使用它。当你登录时,我有很多中介器、注入器、模型、vos 等。注销时我应该删除什么?
提前致谢。
I am building a robotlegs app where you have to login in order to use it. When you loggin I have numerous mediators,injectors,models,vos etc. What should I remove when one logs out?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个问题很难回答,因为你的问题有点模糊。有关内部结构的更多细节将会有所帮助。根据您的情况,您可能只需要删除允许用户访问需要登录的内容的任何导航元素。如果您的用户由持久对象表示,您还可以使用 isLoggedIn< /code> 标志,当用户尝试执行需要登录的操作时,您将进行检查。同样,由于问题含糊不清,这很难回答,但我认为您不需要对 RobotLegs 有任何真正特定的东西这样做,更多的是关于应用程序设计。
This is tough to answer, since your question is kind of vague. Some more details as to the inner structure would be helpful. Depending on your situation, you may just need to remove any navigation elements that would let the user access content that would require them to be logged in. If your user is represented by a persistent object, you could also use an
isLoggedIn
flag that you would check when the user tries doing something that requires them to be logged in. Again, this is tough to answer because of the question's vagueness, but I don't think there's anything really specific to RobotLegs you need to do, it's more about application design.中介器中有一个 onRemove 函数,其工作方式类似于 onRegister,它应该删除中介器中所有已注册的事件。看看吧,它可能就是您正在寻找的。
斯蒂芬
There is a onRemove function in the mediator which works like onRegister, it should remove all the registered events in your mediator. Have a look, it may be what you're looking for.
Stephen