我想重设用户密码,但是我不想创建API,而是想创建一个提示。我正在使用meteor-ionic,可能要使用here
中显示的提示之一Accounts.resetPassword(this.params.token, function() {
IonPopup.prompt({
title: 'Create a new password',
template: 'Please enter your new password',
okText: 'Submit',
inputType: 'password',
inputPlaceholder: 'Your Password',
onOk: function() {
return this.password;
}
});
}, function(err) {
Router.go('home');
});
但是,这将产生错误:
异步函数的回调中的异常:错误:匹配错误:预期的字符串,有功能
如果将Ion.popup()
替换为prompt('please put in password')
,它将起作用。这使我认为onOk
函数不会停止执行。
我如何使用弹出窗口重置流星密码?
我认为您需要的是这样的东西:
onOk: function(event,response) {
return response;