import { getCookie } from 'h3' import { SESSION_COOKIE, destroySession, clearSessionCookie } from '../../utils/auth' /** * 登出:销毁会话并清除 Cookie */ export default defineEventHandler((event) => { const token = getCookie(event, SESSION_COOKIE) if (token) { destroySession(token) } clearSessionCookie(event) return { ok: true } })