|
|
|
@ -65,7 +65,7 @@ class MemoDetail extends Component {
|
|
|
|
|
const memo = response.data.memo
|
|
|
|
|
if (response.data.status === -1) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.props.showSnackbar('帖子不存在!')
|
|
|
|
|
this.props.showNotification('帖子不存在!')
|
|
|
|
|
}, 300)
|
|
|
|
|
this.props.history.push(`/forums`)
|
|
|
|
|
return;
|
|
|
|
@ -127,11 +127,11 @@ class MemoDetail extends Component {
|
|
|
|
|
const status = response.data.status
|
|
|
|
|
if (status === 0) {
|
|
|
|
|
|
|
|
|
|
this.props.showSnackbar('删除成功');
|
|
|
|
|
this.props.showNotification('删除成功');
|
|
|
|
|
this.props.history.push(`/forums`)
|
|
|
|
|
|
|
|
|
|
} else if (status === -1) {
|
|
|
|
|
this.props.showSnackbar('帖子已被删除');
|
|
|
|
|
this.props.showNotification('帖子已被删除');
|
|
|
|
|
this.props.history.push(`/forums`)
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
@ -213,9 +213,9 @@ class MemoDetail extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
replyComment = (commentContent, id, editor) => {
|
|
|
|
|
const { showSnackbar } = this.props;
|
|
|
|
|
const { showNotification } = this.props;
|
|
|
|
|
if (!commentContent || commentContent.length === 0) {
|
|
|
|
|
showSnackbar('必须填写内容!')
|
|
|
|
|
showNotification('必须填写内容!')
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -375,7 +375,7 @@ class MemoDetail extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
rewardCode = (parrentComment, childComment, amount) => {
|
|
|
|
|
const { showSnackbar } = this.props;
|
|
|
|
|
const { showNotification } = this.props;
|
|
|
|
|
const { comments } = this.state;
|
|
|
|
|
let handleComment = parrentComment
|
|
|
|
|
if (childComment) {
|
|
|
|
@ -419,12 +419,12 @@ class MemoDetail extends Component {
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
showSnackbar('奖励失败,请联系系统管理员!')
|
|
|
|
|
showNotification('奖励失败,请联系系统管理员!')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
hiddenComment = (item, childCommentId) => {
|
|
|
|
|
const id = item.id
|
|
|
|
|
const { showSnackbar } = this.props;
|
|
|
|
|
const { showNotification } = this.props;
|
|
|
|
|
const user = this._getUser();
|
|
|
|
|
const url = `/memos/${id}/hidden.json`
|
|
|
|
|
const { comments } = this.state;
|
|
|
|
@ -439,7 +439,7 @@ class MemoDetail extends Component {
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if (response.data.status === -1) {
|
|
|
|
|
showSnackbar(response.data.message)
|
|
|
|
|
showNotification(response.data.message)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (response.data.status === 0) {
|
|
|
|
@ -598,7 +598,7 @@ class MemoDetail extends Component {
|
|
|
|
|
.then((response) => {
|
|
|
|
|
const status = response.data.status
|
|
|
|
|
if (status === 0) {
|
|
|
|
|
this.props.showSnackbar( memo.sticky ? '取消置顶成功' : '置顶成功');
|
|
|
|
|
this.props.showNotification( memo.sticky ? '取消置顶成功' : '置顶成功');
|
|
|
|
|
memo.sticky = memo.sticky ? false : true
|
|
|
|
|
this.setState({
|
|
|
|
|
memo: Object.assign({}, memo)
|
|
|
|
@ -633,9 +633,9 @@ class MemoDetail extends Component {
|
|
|
|
|
this.props.initForumState({
|
|
|
|
|
memo: newMemo
|
|
|
|
|
})
|
|
|
|
|
this.props.showSnackbar( '奖励成功' );
|
|
|
|
|
this.props.showNotification( '奖励成功' );
|
|
|
|
|
} else {
|
|
|
|
|
this.props.showSnackbar( '奖励失败,请联系系统管理员!' );
|
|
|
|
|
this.props.showNotification( '奖励失败,请联系系统管理员!' );
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|