fix: 修复评论提交状态处理和消息显示问题

修复requireReview配置的布尔转换问题,统一前后端评论状态处理逻辑
更新评论提交后的消息显示,支持从API响应中获取消息
This commit is contained in:
anghunk
2026-01-20 22:09:09 +08:00
parent 6a9d5c1167
commit cafabce917
4 changed files with 21 additions and 9 deletions

View File

@@ -230,7 +230,18 @@ export const postComment = async (c: Context<{ Bindings: Bindings }>) => {
}
})());
}
return c.json({ message: "Comment submitted. Awaiting moderation." });
if (defaultStatus === "pending") {
return c.json({
message: '已提交评论,待管理员审核后显示',
status: defaultStatus
});
}
return c.json({
message: '评论已提交',
status: defaultStatus
});
} catch (e: any) {
console.error("Create Comment Error:", e);