From 114d06de8d085eee9357ccbdaeed783773c42d87 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Mon, 30 Jan 2023 15:28:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(mp-weixin):=20=E5=8D=95=E9=A1=B5=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E8=AE=BF=E9=97=AEwx=E9=83=A8=E5=88=86=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-mp-weixin/dist/wx.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/uni-mp-weixin/dist/wx.js b/packages/uni-mp-weixin/dist/wx.js index e00168d6777..0ca023f566b 100644 --- a/packages/uni-mp-weixin/dist/wx.js +++ b/packages/uni-mp-weixin/dist/wx.js @@ -9,15 +9,23 @@ const objectKeys = [ 'router', 'worklet', ] - +const singlePageDisableKey = [ + 'lanDebug', + 'router', + 'worklet', +] const target = typeof globalThis !== 'undefined' ? globalThis : (function() { return this })() const key = ['w', 'x'].join('') const oldWx = target[key] +const launchOption = oldWx.getLaunchOptionsSync() function isWxKey(key) { + if (launchOption.scene === 1154 && singlePageDisableKey.includes(key)) { + return false + } return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function' } @@ -32,4 +40,4 @@ function initWx() { return newWx } target[key] = initWx() -export default target[key] +export default target[key]