移除旧版 HTML 模板与兼容层,并完善私信、举报、媒体存储与 SEO。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-03 16:37:11 +08:00
parent 060b7707cb
commit 48db333272
121 changed files with 11147 additions and 3225 deletions

View File

@@ -22,7 +22,7 @@ export function isGuestComment(c: Comment): boolean {
return !c.user_id || c.user_id === 0;
}
/** 构建嵌套评论树( reply_to */
/** 构建嵌套评论树(优先 thread_parent_id回退 reply_to */
export function buildCommentTree(comments: Comment[]): CommentNode[] {
const map = new Map<number, CommentNode>();
const roots: CommentNode[] = [];
@@ -33,8 +33,9 @@ export function buildCommentTree(comments: Comment[]): CommentNode[] {
for (const c of comments) {
const node = map.get(c.id)!;
if (c.reply_to && map.has(c.reply_to)) {
map.get(c.reply_to)!.children.push(node);
const parentId = c.thread_parent_id ?? c.reply_to;
if (parentId && map.has(parentId)) {
map.get(parentId)!.children.push(node);
} else {
roots.push(node);
}