From 70200220bf46647627b3ab8022f2b7244380ef36 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 30 Jul 2026 00:27:58 +0800 Subject: [PATCH] refactor(auth): split currentUser.ts from auth.ts --- apps/web/src/api/auth/currentUser.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 apps/web/src/api/auth/currentUser.ts diff --git a/apps/web/src/api/auth/currentUser.ts b/apps/web/src/api/auth/currentUser.ts new file mode 100644 index 000000000..a31922de1 --- /dev/null +++ b/apps/web/src/api/auth/currentUser.ts @@ -0,0 +1,11 @@ +import apiClient from "../client" +import type { User, UserResponse } from "./types" +import { normalizeUser } from "./user" + +/** + * 获取当前用户 + */ +export const getCurrentUser = async (): Promise => { + const response = await apiClient.get("/auth/me") + return normalizeUser(response.data) +}