import { http } from "@/utils/http"; export interface Result { code: number; message: string; result: T; success: boolean; timestamp: number; } export interface BaseQuery { size?: number; current?: number; } /** * post */ export function post(url: string, data: T): Promise> { return http.post>(url, { data: data }); } /** * get */ export function get(url: string, params?: T): Promise> { return http.get>(url, { params: params }); } /** * put * @param url path * @param params query * @param data body * @returns . */ export function put( url: string, params?: any, data?: T ): Promise> { return http.request("put", url, { params: params, data: data }); } /** * 删除 * @param url . * @param params . * @param data . * @returns . */ export function deleteRequest( url: string, params?: any, data?: any ): Promise> { return http.request("delete", url, { params: params, data: data }); }