Skip to content

Commit 4ee6bab

Browse files
committed
fix: check login status before like and collect
1 parent 1d21871 commit 4ee6bab

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/components/TopicDetail/index.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class TopicDetail extends Component {
4646
accesstoken,
4747
collectTopic
4848
} = this.props
49+
if (!accesstoken) {
50+
alert('请先登录!')
51+
return
52+
}
4953
if (topic.is_collect) return
5054

5155
collectTopic({
@@ -58,6 +62,11 @@ class TopicDetail extends Component {
5862
accesstoken,
5963
likeComment
6064
} = this.props
65+
if (!accesstoken) {
66+
alert('请先登录!')
67+
return
68+
}
69+
6170
likeComment({
6271
accesstoken,
6372
id

0 commit comments

Comments
 (0)