// server/api/auth/logout.get.ts import type { UserLogoutResult } from "#shared/types"; /** * GET /api/auth/logout * * 登出流程: * 1. 服务端直接转发 GET 请求到上游 NewAPI * 2. 上游成功后统一返回 { code: 0, data: null, msg: "登出成功" } */ export default defineEventHandler(async () => { try { await newApiFetch("/api/user/logout", { method: "GET" }); return createSuccessResponse(null, "登出成功"); } catch (error) { return createUpstreamErrorResponse(error, "登出失败"); } });