perf: 通用CRUD

This commit is contained in:
pan
2024-03-15 18:02:19 +08:00
parent 08ed64d7ef
commit 7443ac3ac4
2 changed files with 66 additions and 30 deletions

View File

@@ -161,6 +161,23 @@ class PureHttp {
): Promise<P> {
return this.request<P>("get", url, params, config);
}
/** 单独抽离的put工具函数 */
public put<T, P>(
url: string,
params?: AxiosRequestConfig<T>,
config?: PureHttpRequestConfig
): Promise<P> {
return this.request<P>("put", url, params, config);
}
/** 单独抽离的delete工具函数 */
public delete<T, P>(
url: string,
params?: AxiosRequestConfig<T>,
config?: PureHttpRequestConfig
): Promise<P> {
return this.request<P>("delete", url, params, config);
}
}
export const http = new PureHttp();