chore: 类型文件统一加前缀 I
This commit is contained in:
2
src/service/foo.d.ts
vendored
2
src/service/foo.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
export type FooItem = {
|
||||
export type IFooItem = {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { http } from '@/utils/http'
|
||||
import type { FooItem } from './foo.d'
|
||||
import type { IFooItem } from './foo.d'
|
||||
|
||||
export { FooItem }
|
||||
export { IFooItem }
|
||||
|
||||
/** get 请求 */
|
||||
export const getFoo = (name: string) => {
|
||||
return http<FooItem>({
|
||||
return http<IFooItem>({
|
||||
url: `/foo`,
|
||||
method: 'GET',
|
||||
query: { name },
|
||||
@@ -14,7 +14,7 @@ export const getFoo = (name: string) => {
|
||||
|
||||
/** get 请求 */
|
||||
export const postFoo = (name: string) => {
|
||||
return http<FooItem>({
|
||||
return http<IFooItem>({
|
||||
url: `/foo`,
|
||||
method: 'POST',
|
||||
query: { name }, // post 请求也支持 query
|
||||
|
||||
Reference in New Issue
Block a user