import request from "@/utils/request"; import type { LoginForm, LoginResponse, User } from "@/types/auth"; export const authApi = { login: async (data: LoginForm): Promise => { const response = await request.post("/auth/login", data); return response as unknown as LoginResponse; }, logout: async (): Promise => { await request.post("/auth/logout"); }, getUserInfo: async (): Promise => { const response = await request.get("/auth/user-info"); return response as unknown as User; }, refreshToken: async (): Promise<{ token: string }> => { const response = await request.post("/auth/refresh-token"); return response as unknown as { token: string }; }, };