fix: 添加删除帖子的 mock handler

- 支持 DELETE /api/posts/:postId 请求
- 从内存存储中正确删除评论
- 修复 mock 模式下删除评论失败的问题

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-15 14:08:14 +08:00
parent 0775409c9f
commit d37cc720ef
3 changed files with 4 additions and 2 deletions

View File

@@ -210,7 +210,8 @@ export const eventService = {
...post,
author: post.user ? {
id: post.user.id,
username: post.user.username,
// 与导航区保持一致:优先显示昵称
username: post.user.nickname || post.user.username,
avatar: post.user.avatar_url || post.user.avatar // 兼容 avatar_url 和 avatar
} : {
id: 'anonymous',