2024-05-04 23:29:21 +08:00
|
|
|
import { http } from '@/utils/http'
|
2024-05-03 19:16:54 +08:00
|
|
|
export interface IFooItem {
|
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
}
|
2024-02-01 15:21:36 +08:00
|
|
|
|
2024-05-03 19:16:54 +08:00
|
|
|
/** GET 请求 */
|
2024-02-01 15:38:11 +08:00
|
|
|
export const getFooAPI = (name: string) => {
|
2025-04-12 11:02:48 +08:00
|
|
|
return http.get<IFooItem>('/foo', { name }, { 'Content-Type-100': '100' })
|
2024-05-03 19:16:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/** POST 请求 */
|
2024-02-01 15:38:11 +08:00
|
|
|
export const postFooAPI = (name: string) => {
|
2025-04-12 11:02:48 +08:00
|
|
|
return http.post<IFooItem>('/foo', { name }, { name }, { 'Content-Type-100': '100' })
|
2024-05-04 23:29:21 +08:00
|
|
|
}
|