这是我写的一段代码。我无法从 Promise 访问数据以供以后使用。
function forgotPassword(params) {
return new Promise(function (resolve, reject) {
return client.methodCall('forgotPassword', params, function (error, value) {
if (error === null) {
if (value === true) {
console.log('Password Sent!!');
//subpy.kill('SIGINT');
return resolve('Password Sent!!');
}
else {
console.log('User Not Found!!');
//subpy.kill('SIGINT');
return resolve('User Not Found!!');
}
}
else {
console.log('Error while doing the Operation!!');
//subpy.kill('SIGINT');
return reject(error);
}
});
}
);
}