我正在尝试使用帐户密码包进行电子邮件验证但是我遇到了一个奇怪的问题 .
电子邮件验证网址中的#似乎导致了问题 . 验证邮件的网址通常如下所示:http://localhost:3000/#/verify-email/cnaTqQSCgYAksIsFo5FgmV94NHwrfaM2g5GvdZDUMlN
当我点击这个时,似乎什么都没发生;它只是重定向到localhost:3000 /#
但是,当我删除#(http://localhost:3000/verify-email/cnaTqQSCgYAksIsFo5FgmV94NHwrfaM2g5GvdZDUMlN)时,这似乎完美无缺 .
URL(http://localhost:3000/#/verify-email/cnaTqQSCgYAksIsFo5FgmV94NHwrfaM2g5GvdZDUMlN)来自Meteor,因此它不是我创建的 .
这是我的路线和控制器(使用铁路由器)
Router.route('/verify-email/:_token', {
controller : 'AccountController',
action : 'verifyEmail'
});
AccountController = RouteController.extend({
fastRender: true,
data: function () {},
onBeforeAction: function () {
this.render('Loading');
this.next();
},
verifyEmail: function() {
var verificationToken = this.params._token;
console.log(verificationToken);
Accounts.verifyEmail(verificationToken, function(error) {
if (error) {
console.log(error);
} else {
Router.go('/');
}
});
}
});
任何帮助表示赞赏 .
1 回答
冲突可能与account-password一起连接到iron:router,如下所示:
...... add a server file that overrides the urls with # paths that Meteor creates, so that the Iron-Router can work:
希望它能引导您朝着正确的方向前进 .