Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.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中更改重置密码url主机_Meteor - Fatal编程技术网

在meteor中更改重置密码url主机

在meteor中更改重置密码url主机,meteor,Meteor,我想更改重置密码电子邮件模板url 我想换衣服 localhost:3000/reset-password/dP8cuMPE220mEPA7l0uSRIq4 到 我已经做到了 Accounts.emailTemplates.resetPassword.text = function(user, url) { url = url.replace('#/', ''); url = url.replace('localhost:3000', 'app.mysite

我想更改重置密码电子邮件模板url

我想换衣服

localhost:3000/reset-password/dP8cuMPE220mEPA7l0uSRIq4

我已经做到了

  Accounts.emailTemplates.resetPassword.text = function(user, url) {
        url = url.replace('#/', '');
        url = url.replace('localhost:3000', 'app.mysite.com');
        return "Click this link to reset your password: " + url;
      };
这适用于我的本地环境,但在生产环境中没有
localhost:3000

所以url不会改变


我想更改主机,如何执行此操作?

您需要设置
根URL
环境参数。Meteor将使用它生成此链接。因此,如果您设置
ROOT\u URL=”http://app.myside.com/
,则生成的url将为
http://app.mysite.com/reset-password/blahBLAH是的,
Accounts.url.resetPassword=function(token){return'http://app.myapp.com/reset-password/'+token;};
这也有效
  Accounts.emailTemplates.resetPassword.text = function(user, url) {
        url = url.replace('#/', '');
        url = url.replace('localhost:3000', 'app.mysite.com');
        return "Click this link to reset your password: " + url;
      };