我已经使用主干定义了一组路由
例如:
Backbone.Routes.prefix = Onethingaday.Routers
Backbone.Routes.map
"!*splat":
"HomeRouter" : "reroute"
"":
"NavbarRouter" : "index"
"SidebarRouter" : "index"
"HomeRouter" : "index"
"all":
"NavbarRouter" : "index"
"SidebarRouter" : "index"
"HomeRouter" : "all"
"news":
"NavbarRouter" : "index"
"SidebarRouter" : "index"
"NotificationsRouter" : "index"
"popular/threads":
"NavbarRouter" : "index"
"SidebarRouter" : "index"
"DiscoverRouter" : "popularThreads"
现在,我想限制对某些路由的访问,即只有在用户“isLoginedIn”时才能访问“所有”和“新闻”路由。我如何在这里进行检查?例如,如果用户尝试访问“所有”和“新闻”页面,我可以检查和比较并将用户重定向到单独的登录页面吗