diff --git a/cwd-comments-admin/src/api/admin.ts b/cwd-comments-admin/src/api/admin.ts index 1bc8389..315a0a7 100644 --- a/cwd-comments-admin/src/api/admin.ts +++ b/cwd-comments-admin/src/api/admin.ts @@ -39,6 +39,7 @@ export type CommentSettingsResponse = { adminBadge: string | null; avatarPrefix: string | null; adminEnabled: boolean; + allowedDomains?: string[]; }; export type EmailNotifySettingsResponse = { @@ -122,6 +123,7 @@ export function saveCommentSettings(data: { adminBadge?: string; avatarPrefix?: string; adminEnabled?: boolean; + allowedDomains?: string[]; }): Promise<{ message: string }> { return put<{ message: string }>('/admin/settings/comments', data); } diff --git a/cwd-comments-admin/src/views/DataView.vue b/cwd-comments-admin/src/views/DataView.vue index a2a834c..06cfdec 100644 --- a/cwd-comments-admin/src/views/DataView.vue +++ b/cwd-comments-admin/src/views/DataView.vue @@ -27,7 +27,8 @@
@@ -188,8 +189,8 @@ async function handleFileChange(event: Event) { // 检测前缀逻辑 let missingCount = 0; for (const item of comments) { - // 优先检查 Twikoo 字段 href,其次检查 CWD 字段 post_slug - const url = item.href || item.post_slug; + // 优先检查 Twikoo 字段 href,其次 Artalk 字段 page_key,最后 CWD 字段 post_slug + const url = item.href || item.page_key || item.post_slug; if (url && typeof url === "string") { if (!url.startsWith("http://") && !url.startsWith("https://")) { missingCount++; @@ -250,6 +251,16 @@ async function confirmPrefix() { } } + // Artalk + if (newItem.page_key && typeof newItem.page_key === "string") { + if ( + !newItem.page_key.startsWith("http://") && + !newItem.page_key.startsWith("https://") + ) { + newItem.page_key = joinUrl(prefix, newItem.page_key); + } + } + // CWD if (newItem.post_slug && typeof newItem.post_slug === "string") { if ( diff --git a/cwd-comments-admin/src/views/SettingsView.vue b/cwd-comments-admin/src/views/SettingsView.vue index 5d9fdc8..babec69 100644 --- a/cwd-comments-admin/src/views/SettingsView.vue +++ b/cwd-comments-admin/src/views/SettingsView.vue @@ -31,6 +31,15 @@ +
+ + +