From e580ea3239902bab17e52314c115657f9489317c Mon Sep 17 00:00:00 2001 From: IchliebedichZhu <54796446@qq.com> Date: Fri, 1 Mar 2024 21:21:53 +0000 Subject: [PATCH] feat: upgrade common request api type --- src/api/material.ts | 6 ++++-- src/utils/axios.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/material.ts b/src/api/material.ts index ec5fdb3..2f28160 100644 --- a/src/api/material.ts +++ b/src/api/material.ts @@ -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 = { diff --git a/src/utils/axios.ts b/src/utils/axios.ts index 68a49af..e654366 100644 --- a/src/utils/axios.ts +++ b/src/utils/axios.ts @@ -85,7 +85,7 @@ const fetch = ( type: TFetchMethod = 'get', exheaders: Record = {}, extra: Record = {} -): Promise> => { +): Promise => { if (params?._noLoading) { delete params._noLoading } else { @@ -106,7 +106,7 @@ const fetch = ( return axios[type](url, params, { headers: Object.assign(headerObject, exheaders), ...extra, - }) as Promise> + }) as Promise } }