client.js 691 Bytes
/**
 * 客服用户端 controller
 *
 * @author: liqi <qi.li@yoho.cn>
 * @date: 2016/11/4
 */

'use strict';
const aes = require('./aes-pwd');
const clientService = require('../models/client-service');

/**
 * 在线客服客户端
 */
const index = (req, res) => {
    let type = 2;
    let imgSize = '400x400';
    // let encryptedUid = aes.encryptionUid(req.user.uid);
    let encryptedUid = aes.encryptionUid(8040155);
    let data = {
        encryptedUid,
        layout: false
    };

    clientService.getClientData(type, encryptedUid, imgSize)
        .then(result => {
            res.render('client', Object.assign(data, result));
        });
};


module.exports = {
    index
};