1

我想显示不同城市的帖子,定义为cityId

FlowRouter.route("/:cityId", {
   name: 'postList',
   action: function() {
      console.log(FlowRouter.getParam("cityId"));
      return BlazeLayout.render('mainLayout', {
        top: 'header',
        body: 'postList'
      });
    }
});

除此之外,我当然还有通用路线,例如“管理员”、“注册”等。
但是当我去 时/signuppostList路线被激活,将“注册”字视为城市 ID,并且“注册”登录到控制台。
定义类似的路线FlowRouter.route("/postList/:cityId")不是一种选择。

4

1 回答 1

1

实际上,您需要控制路由定义顺序。
define the /signup route before the generic one: /:cityId

于 2016-01-08T06:28:30.450 回答