【问题标题】:Meteor's Houston:admin not working with Iron:routerMeteor 的 Houston:admin 不使用 Iron:router
【发布时间】:2015-10-07 16:59:32
【问题描述】:

我正在使用 iron:router 在我的 Meteor 应用程序中定义路径。

现在,我想使用 houston:admin 包为 Meteor 的 Mongodb 提供类似 Django 的管理界面。

问题是:

  • 如果我使用 houston 的管理员 不添加 Iron 的路由器,只需导航到 localhost:3000/admin 即可完美运行
  • 如果我使用 houston 的管理员 在添加 Iron 的路由器后,当我(手动)导航到 localhost:3000/admin 时,它会将我重定向到默认路由(/config ) 我设置客户端。

路由规则在 shared/lib/routing.js 中定义。

默认路由在 client/app.js 中定义为客户端:

 Router.go('config');

【问题讨论】:

    标签: mongodb meteor iron-router


    【解决方案1】:

    一种解决方案是仅在当前路径不以 /admin

    开头时强制执行默认路由

    client/app.js

    if(!Iron.Location.get().path.match(/^\/admin/)){
      Router.go('config');
    }
    

    【讨论】:

    • 第二个作品。首先没有(无法读取未定义的属性.route)
    猜你喜欢
    • 2014-12-25
    • 2016-12-04
    • 1970-01-01
    • 2016-02-13
    • 2015-02-12
    • 1970-01-01
    • 2017-12-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多