本文整理汇总了TypeScript中meteor/meteor.Meteor.user方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Meteor.user方法的具体用法?TypeScript Meteor.user怎么用?TypeScript Meteor.user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meteor/meteor.Meteor
的用法示例。
在下文中一共展示了Meteor.user方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: verifyUser
function verifyUser(){
let user = Meteor.user();
return !!user;
}
示例2: function
insert: function() {
let user = Meteor.user();
return !!user;
},
示例3: loggedIn
// Check if user is logged in
function loggedIn() {
return !!Meteor.user();
}
示例4: addGroupProject
});
});
}
}
for (let k in ret) {
if (!ret[k].email) continue;
retArr.push(ret[k]);
}
return retArr;
},
addGroupProject(projectId: string, groupName: string) {
check(groupName, String);
check(projectId, String);
let user = Meteor.user();
if (!user) {
throw new Meteor.Error('403', 'not-authorized');
}
let project = Projects.findOne({ owner: user._id, _id: projectId });
if (!project) {
throw new Meteor.Error('403', 'not-authorized');
}
if (!project.groups) {
project.groups = [];
}
// check if exists
let exists = false;
project.groups.forEach((group) => {
if (group.name === groupName) {
exists = true;
示例5: canActivate
canActivate() {
if (!Meteor.user()) {
this.router.navigate(['/login']);
}
return !!Meteor.user();
}
示例6:
update: () => {
let user = Meteor.user();
return !!user;
},
示例7: function
let loggedIn = function(){return !!Meteor.user();}