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": {