This commit is contained in:
freedakgmail
2025-11-30 09:16:43 +08:00
parent b436ae0680
commit fd9c064749
227 changed files with 1251 additions and 912 deletions
+24
View File
@@ -0,0 +1,24 @@
import { NextResponse } from "next/server"
import { getServerSession } from "next-auth"
import { authOptions } from "@/lib/auth"
import { prisma } from "@/lib/prisma"
export async function PATCH() {
try {
const session = await getServerSession(authOptions)
if (!session?.user?.id) {
return NextResponse.json({ error: "未授权" }, { status: 401 })
}
await prisma.user.update({
where: { id: session.user.id },
data: { hasSeenHelp: true },
})
return NextResponse.json({ success: true })
} catch (error) {
console.error("更新使用帮助标记失败:", error)
return NextResponse.json({ error: "更新失败" }, { status: 500 })
}
}