feat: upgrade common request api type

This commit is contained in:
IchliebedichZhu 2024-03-01 21:21:53 +00:00
parent e509541711
commit e580ea3239
2 changed files with 6 additions and 4 deletions

View File

@ -11,8 +11,10 @@ import fetch from '@/utils/axios'
export const getKinds = (params: Type.Object = {}) => fetch('design/cate', params)
type TGetListParam = {
cate: number
pageSize: number
first_id?: number
second_id?: string
cate?: number
pageSize?: number
}
export type TGetListData = {

View File

@ -85,7 +85,7 @@ const fetch = <T = any> (
type: TFetchMethod = 'get',
exheaders: Record<string, any> = {},
extra: Record<string, any> = {}
): Promise<AxiosResponse<T>> => {
): Promise<T> => {
if (params?._noLoading) {
delete params._noLoading
} else {
@ -106,7 +106,7 @@ const fetch = <T = any> (
return axios[type](url, params, {
headers: Object.assign(headerObject, exheaders),
...extra,
}) as Promise<AxiosResponse<T>>
}) as Promise<T>
}
}