feat: 补充注释

This commit is contained in:
2026-04-26 01:13:38 +08:00
parent e26e2f5491
commit 4c58f409e9
23 changed files with 206 additions and 95 deletions
+9
View File
@@ -1,3 +1,4 @@
// server/api/auth/logout.get.ts - 登出接口:尽量通知 NewAPI 销毁 session,并清理本地登录态。
import type { IUserLogoutData } from "#shared/types";
import {
clearNewApiAuthCookies,
@@ -7,6 +8,14 @@ import {
toSafeLogError
} from "~~/server/utils";
/**
* GET /api/auth/logout
*
* 流程:
* 1. 使用本站 httpOnly cookie 中的 NewAPI session 调用上游登出。
* 2. 无论上游登出是否成功,都清理本站保存的 session/userId cookie。
* 3. 返回统一成功响应,避免坏 session 残留影响后续登录。
*/
export default defineEventHandler(async (event) => {
const logger = createApiLogger("auth.logout");
logger.info("开始");