From ef39c448cb1b82df13d49d4425271b03304cb9c7 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Thu, 11 Jan 2024 13:55:25 +0800 Subject: [PATCH] add optional adaptar --- src/libs/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/client.ts b/src/libs/client.ts index 7006468e..5f54c89f 100644 --- a/src/libs/client.ts +++ b/src/libs/client.ts @@ -20,7 +20,7 @@ export class BaseRestClient { this.endpoint = endpoint; this.registry = registry; } - async request(request: Request, args: Record, query = '', adapter: (source: any) => T = undefined) { + async request(request: Request, args: Record, query = '', adapter?: (source: any) => T ) { let url = `${request.url.startsWith("http")?'':this.endpoint}${request.url}${query}`; Object.keys(args).forEach((k) => { url = url.replace(`{${k}}`, args[k] || '');