Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Meteor中配置帐户ui_Meteor_Meteor Accounts - Fatal编程技术网

如何在Meteor中配置帐户ui

如何在Meteor中配置帐户ui,meteor,meteor-accounts,Meteor,Meteor Accounts,我在meteor应用程序中使用未设置样式的帐户ui。我试图在登录按钮中单击注销时使我的应用程序转到主页 // Here is the code for welcome page for user <template name="MemberWelcome"> <h1>My Profile</h1> {{> loginButtons}} </template> //这是用户欢迎页面的代码 我的

我在meteor应用程序中使用未设置样式的帐户ui。我试图在登录按钮中单击注销时使我的应用程序转到主页

 // Here is the code for welcome page for user

     <template name="MemberWelcome">
      <h1>My Profile</h1>
      {{> loginButtons}}
      </template>
//这是用户欢迎页面的代码
我的个人资料
{{>loginButtons}

如何执行此操作?

在帐户配置中设置homeRoute:

Accounts.ui.config({
  homeRoute: '/'
});

它应该可以工作。

您使用什么进行路由?Flow Router、Iron Router等?@jordanwillis我正在使用Iron Router我应该在哪里输入此代码?在客户端还是服务器端?我将代码放在客户端的.js文件中,但它不起作用。在您使用的Iron Router上签名后,没有更改路由?您可以在iron router中定义操作前路由,检查用户是否登录,若未登录,则将用户重定向到主页。而且不需要这样做。