Skip to content

Commit

Permalink
fix: 还原 cross-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Aug 1, 2023
1 parent 61c83c7 commit 7b26de0
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ build

# widget
widget
archive.zip
archive.zip
components.d.ts
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@element-plus/icons-vue": "^2.1.0",
"@vueuse/components": "^10.3.0",
"@vueuse/core": "^10.3.0",
"cross-fetch": "^4.0.0",
"element-plus": "^2.3.8",
"js-base64": "^3.7.5",
"pinia": "^2.1.6",
Expand Down
38 changes: 38 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/appInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { createAppLogger } from "~/src/utils/appLogger.ts"
import { DeviceDetection } from "zhi-device"
import xmlbuilder2 from "xmlbuilder2"
import { Deserializer, Serializer, SimpleXmlRpcClient, XmlrpcUtil } from "simple-xmlrpc"
import fetch from "cross-fetch"

/**
* 应用实例
Expand All @@ -43,7 +44,6 @@ export class AppInstance {
this.logger = createAppLogger("app-instance")
this.deviceType = DeviceDetection.getDevice()

// Node 18 已经原生支持fetch,不再 polyfill
this.fetch = fetch
this.xmlbuilder2 = xmlbuilder2
this.simpleXmlrpc = {
Expand Down

0 comments on commit 7b26de0

Please sign in to comment.