From b2a0e356097fa897764d26e9843311671c50df5f Mon Sep 17 00:00:00 2001 From: xingyy <373639591@qq.com> Date: Thu, 7 Dec 2023 11:18:10 +0800 Subject: [PATCH] submit --- src/http/main.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/http/main.ts b/src/http/main.ts index 7dff8bcd..625030a8 100644 --- a/src/http/main.ts +++ b/src/http/main.ts @@ -21,12 +21,11 @@ type HttpMethod = | 'connect'; interface RequestOptions { baseUrl?: string; - dataType?: string; url: string; data?: Record; method?: HttpMethod; header?: Record; - params?: Record; // 新增的参数字段 + params?: Record; } type RequestInterceptor = (config: RequestOptions) => RequestOptions; type ResponseInterceptor = (response: any) => any; @@ -62,7 +61,6 @@ class uniFetch { request(options: RequestOptions): Promise { options = options || {}; options.baseUrl = options.baseUrl || this.baseUrl; - options.dataType = options.dataType || "json"; options.url = options.baseUrl + options.url; options.data = options.data || {}; options.method = options.method || "GET"; @@ -100,7 +98,6 @@ class uniFetch { } private handleError(error: any): any { - // 在这里处理错误 throw error; }