【发布时间】:2017-04-26 17:40:58
【问题描述】:
我想阻止某些用户输入特定的路线。我看过未登录用户的示例:
Router.onBeforeAction
(
function ()
{
if (!Meteor.userId())
this.redirect('/');
else
this.next();
}
);
但是当我尝试时
Router.onBeforeAction
(
function ()
{
if ( !isadmin( Meteor.userId() ) && Router.current().route.getName()=='admin' )
this.redirect('/');
else
this.next();
}
);
我收到下一条消息
iron_core.js?hash 路由调度从未渲染。你忘了 在 onBeforeAction 中调用 this.next()?
【问题讨论】:
标签: javascript meteor iron-router