Skip to content

Commit a8fb9d7

Browse files
committed
fix: check user login status before like comments or dislike
1 parent 82b0814 commit a8fb9d7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pages/topic/topic.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ Page({
3333
},
3434
// 切换评论的点赞状态
3535
fnTapLikeCommentOrDislike(e) {
36-
let oDataSet = e.currentTarget.dataset;
37-
this.fnNetLikeCommentOrDislike(oDataSet.id, oDataSet.index);
36+
// 先检查用户登录状态
37+
if (fnCheckLogin()) {
38+
let oDataSet = e.currentTarget.dataset;
39+
this.fnNetLikeCommentOrDislike(oDataSet.id, oDataSet.index);
40+
}
3841
},
3942
// 切换评论的点赞状态
4043
fnNetLikeCommentOrDislike(sCommentId, nCommentIndex) {

0 commit comments

Comments
 (0)