Authored by 陈轩

im fix

... ... @@ -2,6 +2,7 @@
const orderModel = require('../../home/models/order');
const crypto = global.yoho.crypto;
const imApi = require('../../serverAPI/im');
const userApi = require('../../passport/models/auth-helper');
const imModel = require('../models/im');
const helpers = global.yoho.helpers;
const sign = global.yoho.sign;
... ... @@ -20,22 +21,30 @@ exports.appAdapter = (req, res, next) => {
next();
};
exports.page = (req, res) => {
res.render('chat/index', {
module: 'service',
page: 'chat',
pageStyle: 'service-chat',
width750: true,
localCss: true,
imServer: global.yoho.config.domains.imServer,
imSocket: global.yoho.config.domains.imSocket,
userData: {
uid: req.user.uid,
encrypteduid: req.user.ENCRYPTION_UID || (crypto.encryption(null, req.user.uid + '' || '0')),
avatar: helpers.image(req.user.AVATAR, 100, 100),
uname: req.user.NAME
}
});
exports.page = (req, res, next) => {
let uid = req.user.uid;
userApi.profile(req.user.uid)
.then(userinfo => {
userinfo = userinfo.data;
res.render('chat/index', {
module: 'service',
page: 'chat',
pageStyle: 'service-chat',
width750: true,
localCss: true,
imServer: global.yoho.config.domains.imServer,
imSocket: global.yoho.config.domains.imSocket,
userData: {
uid: uid,
encrypteduid: crypto.encryption(null, uid + ''),
avatar: helpers.image(userinfo.head_ico, 100, 100),
uname: userinfo.profile_name
}
});
}, next);
};
exports.getOrders = (req, res, next) => {
... ...