feat: implement email sending functionality via Resend service

This commit is contained in:
beilunyang
2025-06-21 23:50:46 +08:00
parent 9d55564073
commit e85f6b04bd
27 changed files with 2347 additions and 467 deletions

View File

@@ -0,0 +1,29 @@
import { NextResponse } from "next/server"
import { auth } from "@/lib/auth"
import { checkSendPermission } from "@/lib/send-permissions"
export const runtime = "edge"
export async function GET() {
try {
const session = await auth()
if (!session?.user?.id) {
return NextResponse.json({
canSend: false,
error: "未授权"
})
}
const result = await checkSendPermission(session.user.id)
return NextResponse.json(result)
} catch (error) {
console.error('Failed to check send permission:', error)
return NextResponse.json(
{
canSend: false,
error: "权限检查失败"
},
{ status: 500 }
)
}
}