diff --git a/cwd-comments-api/src/api/admin/getAdminEmail.ts b/cwd-comments-api/src/api/admin/getAdminEmail.ts index 97be819..8782cca 100644 --- a/cwd-comments-api/src/api/admin/getAdminEmail.ts +++ b/cwd-comments-api/src/api/admin/getAdminEmail.ts @@ -9,8 +9,8 @@ export const getAdminEmail = async (c: Context<{ Bindings: Bindings }>) => { const row = await c.env.CWD_DB.prepare('SELECT value FROM Settings WHERE key = ?') .bind('admin_notify_email') .first<{ value: string }>(); - const email = row?.value || c.env.EMAIL_ADDRESS || null; - return c.json({ email: email }); + const email = row?.value || null; + return c.json({ email }); } catch (e: any) { return c.json({ message: e.message }, 500); } diff --git a/cwd-comments-api/src/api/public/postComment.ts b/cwd-comments-api/src/api/public/postComment.ts index 9de7f0d..6d03515 100644 --- a/cwd-comments-api/src/api/public/postComment.ts +++ b/cwd-comments-api/src/api/public/postComment.ts @@ -1,7 +1,7 @@ import { Context } from 'hono'; import { UAParser } from 'ua-parser-js'; import { Bindings } from '../../bindings'; -import { sendCommentNotification, sendCommentReplyNotification, isValidEmail } from '../../utils/email'; +import { sendCommentNotification, sendCommentReplyNotification, isValidEmail, getAdminNotifyEmail } from '../../utils/email'; // 检查内容,将