我想显示不同城市的帖子,定义为cityId
:
FlowRouter.route("/:cityId", {
name: 'postList',
action: function() {
console.log(FlowRouter.getParam("cityId"));
return BlazeLayout.render('mainLayout', {
top: 'header',
body: 'postList'
});
}
});
除此之外,我当然还有通用路线,例如“管理员”、“注册”等。
但是当我去 时/signup
,postList
路线被激活,将“注册”字视为城市 ID,并且“注册”登录到控制台。
定义类似的路线FlowRouter.route("/postList/:cityId")
不是一种选择。