1

我曾经使用npm install ldapjs这个库。和简单的绑定代码:

var ldap = require('ldapjs');
var client = ldap.createClient({
  url: 'ldap://192.168.1.90:389'
})

const baseDN = 'dc=mnw-inc,dc=com'

export function login(username, password) {
  client.bind(rootDN, rootpasswd, function(err, res) {
    // here handle response
  })
}

这是一个反应应用程序,我运行该应用程序。我在控制台中遇到了这个错误

Uncaught TypeError: net.connect is not a function
at connectSocket (client.js:1039)
at Backoff.<anonymous> (client.js:1203)
at Backoff../node_modules/events/events.js.EventEmitter.emit (events.js:84)
at Backoff../node_modules/backoff/lib/backoff.js.Backoff.onBackoff_ (backoff.js:53)

当我调用该login()函数时,什么都没有返回。我能做什么?

4

0 回答 0