feat: 分离文章slug与URL字段并支持slug模式匹配查询
- 新增 `post_url` 字段存储文章完整URL,`post_slug` 仅存储标识符 - 更新管理后台评论列表、编辑、统计及域名获取接口以使用新字段 - 修改公共评论查询接口,支持slug精确匹配及带`?`、`#`参数的模糊匹配 - 更新前端管理界面,在评论编辑表单中增加"评论地址"(`postUrl`)字段 - 同步更新API文档,明确字段用途及查询参数说明
This commit is contained in:
@@ -263,6 +263,7 @@ const editForm = ref<{
|
||||
email: string;
|
||||
url: string;
|
||||
postSlug: string;
|
||||
postUrl: string;
|
||||
contentText: string;
|
||||
status: string;
|
||||
priority: number;
|
||||
@@ -438,6 +439,7 @@ function openEdit(item: CommentItem) {
|
||||
email: item.email,
|
||||
url: item.url || "",
|
||||
postSlug: item.postSlug || "",
|
||||
postUrl: item.postUrl || "",
|
||||
contentText: item.contentText,
|
||||
status: item.status,
|
||||
priority:
|
||||
@@ -466,6 +468,7 @@ async function submitEdit() {
|
||||
const trimmedContent = current.contentText.trim();
|
||||
const trimmedUrl = current.url.trim();
|
||||
const trimmedPostSlug = current.postSlug.trim();
|
||||
const trimmedPostUrl = current.postUrl.trim();
|
||||
const priorityValue =
|
||||
typeof current.priority === "number" && Number.isFinite(current.priority)
|
||||
? current.priority
|
||||
@@ -485,6 +488,7 @@ async function submitEdit() {
|
||||
name: trimmedName,
|
||||
email: trimmedEmail,
|
||||
url: trimmedUrl || null,
|
||||
postUrl: trimmedPostUrl || null,
|
||||
postSlug: newPostSlug,
|
||||
contentText: trimmedContent,
|
||||
status: current.status,
|
||||
@@ -497,6 +501,7 @@ async function submitEdit() {
|
||||
email: trimmedEmail,
|
||||
url: trimmedUrl || null,
|
||||
postSlug: newPostSlug,
|
||||
postUrl: trimmedPostUrl || null,
|
||||
contentText: trimmedContent,
|
||||
status: current.status,
|
||||
priority: priorityValue,
|
||||
|
||||
Reference in New Issue
Block a user