mirror of
https://github.com/201206030/novel-front-web.git
synced 2025-04-27 07:50:50 +00:00
feat: 评论删除功能
This commit is contained in:
parent
ce5497f24f
commit
f66732f21b
@ -14,4 +14,8 @@ export function submitFeedBack(params) {
|
|||||||
|
|
||||||
export function comment(params) {
|
export function comment(params) {
|
||||||
return request.post('/user/comment',params);
|
return request.post('/user/comment',params);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteComment(id) {
|
||||||
|
return request.delete(`/user/comment/${id}`);
|
||||||
}
|
}
|
@ -157,10 +157,10 @@
|
|||||||
><span class="fr"
|
><span class="fr"
|
||||||
><a
|
><a
|
||||||
href="javascript:void(0);"
|
href="javascript:void(0);"
|
||||||
onclick="javascript:BookDetail.AddAgreeTotal(77,this);"
|
@click="deleteUserComment(item.id)"
|
||||||
class="zan"
|
class="zan"
|
||||||
style="display: none"
|
|
||||||
>赞<i class="num">(0)</i></a
|
>删除</a
|
||||||
></span
|
></span
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
@ -295,7 +295,7 @@ import {
|
|||||||
listRecBooks,
|
listRecBooks,
|
||||||
listNewestComments,
|
listNewestComments,
|
||||||
} from "@/api/book";
|
} from "@/api/book";
|
||||||
import { comment } from "@/api/user";
|
import { comment , deleteComment} from "@/api/user";
|
||||||
import Header from "@/components/common/Header";
|
import Header from "@/components/common/Header";
|
||||||
import Footer from "@/components/common/Footer";
|
import Footer from "@/components/common/Footer";
|
||||||
import author_head from "@/assets/images/author_head.png";
|
import author_head from "@/assets/images/author_head.png";
|
||||||
@ -389,6 +389,11 @@ export default {
|
|||||||
loadNewestComments(state.book.id)
|
loadNewestComments(state.book.id)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const deleteUserComment = async (id) => {
|
||||||
|
await deleteComment(id)
|
||||||
|
loadNewestComments(state.book.id)
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
author_head,
|
author_head,
|
||||||
@ -398,6 +403,7 @@ export default {
|
|||||||
chapterList,
|
chapterList,
|
||||||
goToAnchor,
|
goToAnchor,
|
||||||
userComment,
|
userComment,
|
||||||
|
deleteUserComment,
|
||||||
man
|
man
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user