home.js 514 Bytes
'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    this.ctx.body = 'hi, ' + this.app.plugins.ldapjs.name;
    const opts = {
      filter: '(objectclass=organizationalUnit)',
      scope: 'sub',
      attributes: [ 'dn', 'sn', 'cn', 'ou' ],
    };
    console.log(this.app.ldapjs);
    const result = await this.app.ldapjs.search('dc=dodokeroro,dc=cn', opts);
    console.log('result::::', result);
  }
}

module.exports = HomeController;