且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Meteor.js登录事件

更新时间:2023-12-04 08:24:10

我不知道是否你这样做的方式是最合适的,但是在客户端亲自执行以下操作来检测用户是否已登录:

I don't know if the way you're doing it is the most appropriate but personally do the following on the client side to detect if a user logged in:

Tracker.autorun(function(){
  if(Meteor.userId()){
    //do your stuff
  }
});