Authored by 李奇

/leavemessage/saveLeavemessage接口session_key验证添加

... ... @@ -129,11 +129,12 @@ const queryReason = (req, res, next) => {
* @param next
*/
const saveMessage = (req, res, next) => {
const uid = req.user.uid;
const content = req.body.content;
const encId = req.body.encryptedUid;
const cvId = req.body.conversationId;
clientApi.saveMessage(content, encId, cvId)
clientApi.saveMessage(content, encId, cvId, uid)
.then(result => {
res.json(result);
}).catch(next);
... ...
... ... @@ -114,8 +114,9 @@ const queryReason = (uid, encryptedUid, type) => {
* @param cvId 会话ID
* @returns {*}
*/
const saveMessage = (content, encId, cvId) => {
const saveMessage = (content, encId, cvId, uid) => {
const params = {
uid,
content,
encryptedUid: encId,
conversationId: cvId
... ...
... ... @@ -697,7 +697,13 @@ function _loadPage() {
encryptedUid: encryptedUid,
conversationId: socketConfCM.conversationId
})
.done(function() {})
.done(function(res) {
if (res && res.code === 401) {
window.onbeforeunload = null;
return location.href = '//www.yohobuy.com/signin.html?refer=' + // eslint-disable-line
encodeURIComponent(location.href);
}
})
.always(function() {
lMsg.modal('hide');
});
... ...