refactor(auth): split currentUser.ts from auth.ts

This commit is contained in:
2026-07-30 00:27:58 +08:00
parent 070cc72719
commit 70200220bf
+11
View File
@@ -0,0 +1,11 @@
import apiClient from "../client"
import type { User, UserResponse } from "./types"
import { normalizeUser } from "./user"
/**
* 获取当前用户
*/
export const getCurrentUser = async (): Promise<User> => {
const response = await apiClient.get<UserResponse>("/auth/me")
return normalizeUser(response.data)
}