From 526023e0b05016119f94175d7fa95538b16df95f Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Fri, 18 Feb 2022 14:55:04 +0800 Subject: [PATCH] fix: axios type --- src/utils/http/index.ts | 12 ++++++------ src/utils/http/types.d.ts | 12 ++++++++++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/utils/http/index.ts b/src/utils/http/index.ts index 2c99fa5..625ca61 100644 --- a/src/utils/http/index.ts +++ b/src/utils/http/index.ts @@ -145,21 +145,21 @@ class PureHttp { } // 单独抽离的post工具函数 - public post( + public post( url: string, params?: T, config?: PureHttpRequestConfig - ): Promise { - return this.request("post", url, params, config); + ): Promise

{ + return this.request

("post", url, params, config); } // 单独抽离的get工具函数 - public get( + public get( url: string, params?: T, config?: PureHttpRequestConfig - ): Promise { - return this.request("get", url, params, config); + ): Promise

{ + return this.request

("get", url, params, config); } } diff --git a/src/utils/http/types.d.ts b/src/utils/http/types.d.ts index 985cc37..55a7db9 100644 --- a/src/utils/http/types.d.ts +++ b/src/utils/http/types.d.ts @@ -34,6 +34,14 @@ export default class PureHttp { param?: AxiosRequestConfig, axiosConfig?: PureHttpRequestConfig ): Promise; - post(url: string, params?: T, config?: PureHttpRequestConfig): Promise; - get(url: string, params?: T, config?: PureHttpRequestConfig): Promise; + post( + url: string, + params?: T, + config?: PureHttpRequestConfig + ): Promise

; + get( + url: string, + params?: T, + config?: PureHttpRequestConfig + ): Promise

; }