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,7 +21,13 @@ exports.appAdapter = (req, res, next) => {
next();
};
exports.page = (req, res) => {
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',
... ... @@ -30,12 +37,14 @@ exports.page = (req, res) => {
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
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) => {
... ...