...
|
...
|
@@ -33,9 +33,15 @@ export default { |
|
|
|
|
|
// 更新点赞
|
|
|
[Types.UPDATE_ARTICLE_PRAISE](state, {articleId, status, index}) {
|
|
|
let article = state.articleList[index];
|
|
|
let article = null;
|
|
|
|
|
|
if (article.articleId === parseInt(articleId, 10)) {
|
|
|
if (index) {
|
|
|
article = state.articleList[index];
|
|
|
} else {
|
|
|
article = state.articleList.find(item => +item.articleId === +articleId);
|
|
|
}
|
|
|
|
|
|
if (article && article.articleId === parseInt(articleId, 10)) {
|
|
|
if (article.praiseCount === 0 && status === 0) {
|
|
|
article.praiseCount += 1;
|
|
|
article.hasPraised = 'Y';
|
...
|
...
|
|