feat(admin): 实现评论数据导入功能并优化界面
- 添加导入评论的API接口和前端实现 - 在数据管理页面增加导入功能,支持选择来源和上传JSON文件 - 优化导航菜单和页面标题的命名 - 移除调试用的console.log语句 - 更新相关API文档
This commit is contained in:
@@ -251,11 +251,8 @@ export class CommentItem extends Component {
|
||||
}
|
||||
|
||||
handleReply() {
|
||||
console.log('[CommentItem] handleReply called, comment.id:', this.props.comment.id);
|
||||
if (this.props.onReply) {
|
||||
this.props.onReply(this.props.comment.id);
|
||||
} else {
|
||||
console.warn('[CommentItem] onReply callback is missing!');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,11 +41,6 @@ export class CommentList extends Component {
|
||||
|
||||
render() {
|
||||
const { comments, loading, error, currentPage, totalPages } = this.props;
|
||||
|
||||
console.log('[CommentList] render called, comments:', comments);
|
||||
console.log('[CommentList] comments.length:', comments?.length);
|
||||
console.log('[CommentList] loading:', loading);
|
||||
|
||||
// 清空容器
|
||||
this.empty(this.container);
|
||||
|
||||
@@ -93,7 +88,6 @@ export class CommentList extends Component {
|
||||
this.commentItems.clear();
|
||||
|
||||
comments.forEach((comment, index) => {
|
||||
console.log(`[CommentList] Rendering comment ${index}:`, comment);
|
||||
const commentItem = new CommentItem(commentsContainer, {
|
||||
comment,
|
||||
replyingTo: this.props.replyingTo,
|
||||
@@ -113,8 +107,6 @@ export class CommentList extends Component {
|
||||
this.commentItems.set(comment.id, commentItem);
|
||||
});
|
||||
|
||||
console.log('[CommentList] Final commentsContainer children count:', commentsContainer.children.length);
|
||||
console.log('[CommentList] Final commentsContainer innerHTML:', commentsContainer.innerHTML);
|
||||
root.appendChild(commentsContainer);
|
||||
} else {
|
||||
// 空状态
|
||||
|
||||
Reference in New Issue
Block a user