...
|
...
|
@@ -5,8 +5,6 @@ |
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
const cookie = global.yoho.cookie;
|
|
|
const logger = global.yoho.logger;
|
|
|
const commentModel = require('../models/comment');
|
|
|
const _ = require('lodash');
|
...
|
...
|
@@ -14,7 +12,7 @@ const _ = require('lodash'); |
|
|
|
|
|
// comment page
|
|
|
exports.index = (req, res, next) => {
|
|
|
let uid = cookie.getUid(req);
|
|
|
let uid = req.user.uid;
|
|
|
let isComment = req.query.isComment;
|
|
|
let page = req.query.page || 1;
|
|
|
|
...
|
...
|
@@ -42,7 +40,7 @@ exports.saveComment = (req, res, next) => { |
|
|
|
|
|
// get post args
|
|
|
let data = {
|
|
|
uid: cookie.getUid(req),
|
|
|
uid: req.user.uid,
|
|
|
productSkn: req.body.productSkn,
|
|
|
productId: req.body.productId,
|
|
|
content: req.body.content,
|
...
|
...
|
@@ -57,5 +55,6 @@ exports.saveComment = (req, res, next) => { |
|
|
})
|
|
|
.catch(error => {
|
|
|
logger.error(`home--comment: ${error}`);
|
|
|
next();
|
|
|
});
|
|
|
}; |
...
|
...
|
|