在我的项目中,我需要在 User -> Sign out 上调用回调函数,以便将 Session 值设置为“null”。
有没有办法覆盖Meteor.logout()
行为?如何提供该回调函数?
谢谢
在我的项目中,我需要在 User -> Sign out 上调用回调函数,以便将 Session 值设置为“null”。
有没有办法覆盖Meteor.logout()
行为?如何提供该回调函数?
谢谢
Meteor.logout() 有一个回调函数。
http://docs.meteor.com/#meteor_logout
Meteor.logout(function(err) {
// callback
Session.set("ses",false);
});
--
Template.tplName.events
"click #logout": (e, tmpl) ->
Meteor.logout ->
Session.set "ses", false