client.js
723 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; // 2: YOHO在线客服设置
// let encryptionUid = aes.encryptionUid(req.user.uid);
let encryptionUid = req.user.uid;
let imgSize = '400x400'; // todo
let data = {
layout: false,
uid: encryptionUid
};
clientService.getClientData(type, encryptionUid, imgSize)
.then(result => {
res.render('client', Object.assign(data, result));
});
};
module.exports = {
index
};