diff --git a/app/pages/me/admin/config/index.vue b/app/pages/me/admin/config/index.vue index 5d39e90..51391d8 100644 --- a/app/pages/me/admin/config/index.vue +++ b/app/pages/me/admin/config/index.vue @@ -26,6 +26,7 @@ const { refresh: refreshGlobalConfig } = useGlobalConfig() const loading = ref(true) const saving = ref(false) +const testingEmail = ref(false) const siteName = ref('') const allowRegister = ref(true) const mediaOrphanAutoSweepEnabled = ref(false) @@ -101,6 +102,21 @@ async function save() { saving.value = false } } + +async function sendTestEmail() { + testingEmail.value = true + try { + const result = await fetchData<{ message: string }>('/api/config/global/comment-email-test', { + method: 'POST', + }) + toast.add({ title: result.message || '测试邮件发送成功,请检查邮箱', color: 'success' }) + } catch (error) { + const message = error instanceof Error ? error.message : '测试邮件发送失败' + toast.add({ title: message, color: 'error' }) + } finally { + testingEmail.value = false + } +}