我有登录身份验证页面。我正在尝试删除用户(如果不再需要)。但是,当我运行以下代码时,出现以下错误:
[Error in catch : TypeError: client.remove is not a function]
LDAP代码:
var ldap = require('ldapjs');
try {
var client = ldap.createClient({
url: "-----",
connectTimeout:120000,
timeout:120000,
idleTimeout:120000,
reconnect:true
});
client.remove('cn=testing, ou=People, dc=---,dc=com',function(error, success) {
if (error) {
client.destroy();
console.log('User Doesnot exist!!');
} else {
client.destroy();
console.log('User is Deleted..');
}
});
} catch (error_1) {
console.log('Error in catch : ' + error_1.stack);
}
有人对我做错了什么建议吗?