fix(net-tool): getHeaders的定义错误
All checks were successful
/ release (push) Successful in 45s

This commit is contained in:
zhaoyingbo 2024-08-23 01:40:34 +00:00
parent 3319f59f17
commit 6c87994d5d

View File

@ -37,7 +37,7 @@ export class NetError extends Error {
class NetToolBase {
protected prefix: string
protected headers: Record<string, string>
protected getHeaders: () => Record<string, string>
protected getHeaders: () => Promise<Record<string, string>>
protected logger: Logger
protected requestId: string
@ -58,12 +58,12 @@ class NetToolBase {
}: {
prefix?: string
headers?: Record<string, string>
getHeaders?: () => Record<string, string>
getHeaders?: () => Promise<Record<string, string>>
requestId?: string
} = {}) {
this.prefix = prefix || ""
this.headers = headers || {}
this.getHeaders = getHeaders || (() => ({}))
this.getHeaders = getHeaders || (async () => ({}))
this.requestId = requestId || ""
this.logger = logger.child({ requestId })
}
@ -86,7 +86,7 @@ class NetToolBase {
}: {
prefix?: string
headers?: Record<string, string>
getHeaders?: () => Record<string, string>
getHeaders?: () => Promise<Record<string, string>>
requestId?: string
} = {}) {
return new NetToolBase({