From fd0de3b457b9588dca85ff2748696f77a535a156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E6=B6=9B?= Date: Wed, 13 Aug 2025 23:29:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DJSSDK=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 8 +++++--- package.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 711af88..197fc3f 100644 --- a/index.js +++ b/index.js @@ -59,14 +59,16 @@ const wxSDK = (options = {}) => { } // SDK 加载管理 - const scriptId = 'Pd_share' + const scriptId = 'wxShare' let scriptTag = document.getElementById(scriptId) let loadTimeout const cleanup = () => { clearTimeout(loadTimeout) - scriptTag.onload = null - scriptTag.onerror = null + if (scriptTag) { + scriptTag.onload = null + scriptTag.onerror = null + } } const loadSDK = () => { diff --git a/package.json b/package.json index b684032..2f2ba2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wxsdk-pure", - "version": "1.0.1", + "version": "1.0.2", "description": "微信分享 SDK 封装", "main": "index.js", "scripts": {