mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-04-25 16:07:19 +08:00
fix: axios type
This commit is contained in:
parent
885cbf2d9f
commit
526023e0b0
@ -145,21 +145,21 @@ class PureHttp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 单独抽离的post工具函数
|
// 单独抽离的post工具函数
|
||||||
public post<T>(
|
public post<T, P>(
|
||||||
url: string,
|
url: string,
|
||||||
params?: T,
|
params?: T,
|
||||||
config?: PureHttpRequestConfig
|
config?: PureHttpRequestConfig
|
||||||
): Promise<T> {
|
): Promise<P> {
|
||||||
return this.request<T>("post", url, params, config);
|
return this.request<P>("post", url, params, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 单独抽离的get工具函数
|
// 单独抽离的get工具函数
|
||||||
public get<T>(
|
public get<T, P>(
|
||||||
url: string,
|
url: string,
|
||||||
params?: T,
|
params?: T,
|
||||||
config?: PureHttpRequestConfig
|
config?: PureHttpRequestConfig
|
||||||
): Promise<T> {
|
): Promise<P> {
|
||||||
return this.request<T>("get", url, params, config);
|
return this.request<P>("get", url, params, config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
src/utils/http/types.d.ts
vendored
12
src/utils/http/types.d.ts
vendored
@ -34,6 +34,14 @@ export default class PureHttp {
|
|||||||
param?: AxiosRequestConfig,
|
param?: AxiosRequestConfig,
|
||||||
axiosConfig?: PureHttpRequestConfig
|
axiosConfig?: PureHttpRequestConfig
|
||||||
): Promise<T>;
|
): Promise<T>;
|
||||||
post<T>(url: string, params?: T, config?: PureHttpRequestConfig): Promise<T>;
|
post<T, P>(
|
||||||
get<T>(url: string, params?: T, config?: PureHttpRequestConfig): Promise<T>;
|
url: string,
|
||||||
|
params?: T,
|
||||||
|
config?: PureHttpRequestConfig
|
||||||
|
): Promise<P>;
|
||||||
|
get<T, P>(
|
||||||
|
url: string,
|
||||||
|
params?: T,
|
||||||
|
config?: PureHttpRequestConfig
|
||||||
|
): Promise<P>;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user