mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
feat: upgrade common request api type
This commit is contained in:
parent
e509541711
commit
e580ea3239
@ -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 = {
|
||||
|
@ -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>
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user