Compare commits

...

2 Commits

Author SHA1 Message Date
ed63a201ea chore(release): publish
- @egg/net-tool@1.5.1
2024-08-23 01:41:08 +00:00
6c87994d5d fix(net-tool): getHeaders的定义错误
All checks were successful
/ release (push) Successful in 45s
2024-08-23 01:40:34 +00:00
4 changed files with 12 additions and 6 deletions

2
package-lock.json generated
View File

@ -12272,7 +12272,7 @@
},
"packages/net-tool": {
"name": "@egg/net-tool",
"version": "1.5.0",
"version": "1.5.1",
"license": "ISC",
"dependencies": {
"@egg/logger": "^1.3.0",

View File

@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.5.1](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/net-tool@1.5.0...@egg/net-tool@1.5.1) (2024-08-23)
### Bug Fixes
- **net-tool:** getHeaders的定义错误 ([6c87994](http://yingbo.im:3000/zhaoyingbo/egg_tools/commits/6c87994d5d6e392ae18bc95dbef3898e91d55f64))
# [1.5.0](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/net-tool@1.4.0...@egg/net-tool@1.5.0) (2024-08-23)
### Features

View File

@ -1,6 +1,6 @@
{
"name": "@egg/net-tool",
"version": "1.5.0",
"version": "1.5.1",
"description": "Net Tools for Egg projects",
"type": "module",
"main": "src/index.ts",

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({