Authored by zhangxiaoru

editorial

@@ -198,7 +198,7 @@ let addComment = (req, res, next) => { @@ -198,7 +198,7 @@ let addComment = (req, res, next) => {
198 let id = req.body.id; 198 let id = req.body.id;
199 let content = req.body.content; 199 let content = req.body.content;
200 200
201 - editorialModel.setCollect(id, uid, content).then((result) => { 201 + editorialModel.addComment(id, uid, content).then((result) => {
202 res.json(result); 202 res.json(result);
203 }).catch(next); 203 }).catch(next);
204 }; 204 };
@@ -19,13 +19,13 @@ $('.editorial-index-page').on('click', '.like-icon', function() { @@ -19,13 +19,13 @@ $('.editorial-index-page').on('click', '.like-icon', function() {
19 var $this = $(this), 19 var $this = $(this),
20 20
21 // prising = false, 21 // prising = false,
22 - msgId = $this.closest('.msg-content').data('id'), 22 + msgId = $this.pardents('.msg-content').data('id'),
23 url; 23 url;
24 24
25 // if (prising === msgId) { 25 // if (prising === msgId) {
26 // return; 26 // return;
27 // } 27 // }
28 - console.log(msgId) 28 + console.log(msgId);
29 29
30 // prising = msgId; 30 // prising = msgId;
31 31
@@ -12,7 +12,7 @@ lazyLoad($('.content-msg img.lazy')); @@ -12,7 +12,7 @@ lazyLoad($('.content-msg img.lazy'));
12 $('.editorial-list-page').on('click', '.like-icon', function() { 12 $('.editorial-list-page').on('click', '.like-icon', function() {
13 13
14 var $this = $(this), 14 var $this = $(this),
15 - msgId = $this.closest('.msg-content').data('id'), 15 + msgId = $this.parents('.msg-content').data('id'),
16 url; 16 url;
17 17
18 if ($this.hasClass('liked')) { 18 if ($this.hasClass('liked')) {