如何进行异步调用?我试着用这个代码:
abc = await ad.authenticate(username, password, function(err, auth) {
if(err){
console.log('ERROR: '+JSON.stringify(err));
fail_found = err.name;
return;
}
if(auth){
console.log('Authenticated!');
}else{
console.log('Authenticated Faliled');
fail_found = 'No Authenticated ';
}
});
}
console.log("Fails?: ",fail_found);
NPM:https://www.npmjs.com/package/activedirectory2 Github:https://github.com/jsumners/node-activedirectory/
谢谢!
1条答案
按热度按时间ny6fqffe1#
你可以尝试使用Promise:
或者在文档的第一部分显示一个promiseWrapper: