feat: 门禁增强 — 输错5次锁定1h + 退出登录

This commit is contained in:
ice-a
2026-10-16 19:15:15 +08:00
parent 9b3113bc33
commit 2c781164f0
10 changed files with 137 additions and 13 deletions
+11
View File
@@ -0,0 +1,11 @@
// 退出登录:清除 HTTP-only 的访问 cookie
export default defineEventHandler((event) => {
if (!process.env.WEBPASSWORD) return { ok: true }
setCookie(event, 'web_unlock', '', {
httpOnly: true,
sameSite: 'lax',
path: '/',
maxAge: 0
})
return { ok: true }
})