浏览代码

fix: axios type

xiaoxian521 3 年之前
父节点
当前提交
7103b04283
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      src/utils/http/types.d.ts

+ 10 - 2
src/utils/http/types.d.ts

@@ -34,6 +34,14 @@ export default class PureHttp {
     param?: AxiosRequestConfig,
     axiosConfig?: PureHttpRequestConfig
   ): Promise<T>;
-  post<T>(url: string, params?: T, config?: PureHttpRequestConfig): Promise<T>;
-  get<T>(url: string, params?: T, config?: PureHttpRequestConfig): Promise<T>;
+  post<T, P>(
+    url: string,
+    params?: T,
+    config?: PureHttpRequestConfig
+  ): Promise<P>;
+  get<T, P>(
+    url: string,
+    params?: T,
+    config?: PureHttpRequestConfig
+  ): Promise<P>;
 }