提交 8a874fa2 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

refactor(mp-weixin): wx.getLaunchOptionsSync 兼容

上级 114d06de
......@@ -20,10 +20,10 @@ const target = typeof globalThis !== 'undefined' ? globalThis : (function() {
const key = ['w', 'x'].join('')
const oldWx = target[key]
const launchOption = oldWx.getLaunchOptionsSync()
const launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null
function isWxKey(key) {
if (launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
return false
}
return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册