Authored by 李奇

/leavemessage/saveLeavemessage接口session_key添加

... ... @@ -78,11 +78,12 @@ exports.fetchHistory = (req, res) => {
* content 留言内容
*/
exports.saveMSG = (req, res) => {
let encryptedUid = req.body.encryptedUid;
const uid = req.user.uid || req.query.uid;
const encryptedUid = req.body.encryptedUid;
const conversationId = req.body.conversationId;
const content = req.body.content;
imApi.saveMessage(encryptedUid, conversationId, content)
imApi.saveMessage(uid, encryptedUid, conversationId, content)
.then(result => {
res.json(result);
});
... ...
... ... @@ -18,8 +18,9 @@ const ImService = new global.yoho.ApiBase(config.domains.imCs, {
* @param {int} conversationId 会话id
* @param {str} content 留言内容
*/
exports.saveMessage = (encryptedUid, conversationId, content) => {
exports.saveMessage = (uid, encryptedUid, conversationId, content) => {
let params = {
uid,
conversationId,
content,
encryptedUid
... ...
... ... @@ -64,7 +64,10 @@ LeaveMSGView.prototype = $.extend({}, EventEmitter.prototype, {
}
api.leaveMsg(content)
.done(function() {
.done(function(res) {
if (res && res.code === 401) {
window.location.href = '//m.yohobuy.com/signin.html?refer=' + window.location.href;
}
self.trigger('save.LeaveMSGView', '留言成功');
self.$input.val('');
})
... ...