import type { ApiResponse } from "@/lib/api" import type { ApiIndexItem } from "@/lib/models/dashboard" import { callPublic } from "./base" export async function fetchApiIndex(): Promise< ApiResponse > { const res = await callPublic( "/user/ApiIndex", undefined, "GET", ) if (!res.success) return res // 兼容后端返回单对象或数组两种格式 const item = Array.isArray(res.data) ? res.data[0] : res.data return { success: true, data: item ?? null } }