import { http, httpGet } from '@/utils/http' export interface IFooItem { id: string name: string } /** GET 请求 */ export const getFooAPI = (name: string) => { return http({ url: `/foo`, method: 'GET', query: { name }, }) } /** GET 请求 - 再次简化,看大家是否喜欢这种简化 */ export const getFooAPI2 = (name: string) => { return httpGet('/foo', { name }) } /** POST 请求 */ export const postFooAPI = (name: string) => { return http({ url: `/foo`, method: 'POST', query: { name }, // post 请求也支持 query data: { name }, }) }