Merge branch 'main' into codex/add-article-pinning-feature

This commit is contained in:
Tim
2025-07-22 19:13:17 +08:00
committed by GitHub
5 changed files with 392 additions and 0 deletions

View File

@@ -156,6 +156,7 @@ export default {
const articleMenuItems = computed(() => {
const items = []
if (isAuthor.value || isAdmin.value) {
items.push({ text: '编辑文章', onClick: () => editPost() })
items.push({ text: '删除文章', color: 'red', onClick: () => deletePost() })
}
if (isAdmin.value) {
@@ -432,6 +433,10 @@ export default {
toast.error('操作失败')
}
}
const editPost = () => {
router.push(`/posts/${postId}/edit`)
}
const deletePost = async () => {
const token = getToken()
@@ -545,6 +550,7 @@ export default {
status,
isAdmin,
approvePost,
editPost,
onCommentDeleted,
deletePost,
pinPost,