修复JSSDK加载判断错误

This commit is contained in:
2025-08-13 23:29:26 +08:00
parent 1f3279e222
commit fd0de3b457
2 changed files with 6 additions and 4 deletions

View File

@@ -59,14 +59,16 @@ const wxSDK = (options = {}) => {
} }
// SDK 加载管理 // SDK 加载管理
const scriptId = 'Pd_share' const scriptId = 'wxShare'
let scriptTag = document.getElementById(scriptId) let scriptTag = document.getElementById(scriptId)
let loadTimeout let loadTimeout
const cleanup = () => { const cleanup = () => {
clearTimeout(loadTimeout) clearTimeout(loadTimeout)
scriptTag.onload = null if (scriptTag) {
scriptTag.onerror = null scriptTag.onload = null
scriptTag.onerror = null
}
} }
const loadSDK = () => { const loadSDK = () => {

View File

@@ -1,6 +1,6 @@
{ {
"name": "wxsdk-pure", "name": "wxsdk-pure",
"version": "1.0.1", "version": "1.0.2",
"description": "微信分享 SDK 封装", "description": "微信分享 SDK 封装",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {