mirror of
http://36.133.248.69:3088/admin/RentWeAppFront.git
synced 2026-03-16 13:52:26 +08:00
init
This commit is contained in:
55
node_modules/@dcloudio/uni-mp-weixin/dist/wx.js
generated
vendored
Normal file
55
node_modules/@dcloudio/uni-mp-weixin/dist/wx.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
const objectKeys = [
|
||||
'qy',
|
||||
'env',
|
||||
'error',
|
||||
'version',
|
||||
'lanDebug',
|
||||
'cloud',
|
||||
'serviceMarket',
|
||||
'router',
|
||||
'worklet',
|
||||
'__webpack_require_UNI_MP_PLUGIN__'
|
||||
]
|
||||
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 ? oldWx.getLaunchOptionsSync() : null
|
||||
|
||||
function isWxKey (key) {
|
||||
if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
|
||||
return false
|
||||
}
|
||||
return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function'
|
||||
}
|
||||
|
||||
function initWx () {
|
||||
const newWx = {}
|
||||
for (const key in oldWx) {
|
||||
if (isWxKey(key)) {
|
||||
// TODO wrapper function
|
||||
newWx[key] = oldWx[key]
|
||||
}
|
||||
}
|
||||
return newWx
|
||||
}
|
||||
target[key] = initWx()
|
||||
if (!target[key].canIUse('getAppBaseInfo')) {
|
||||
target[key].getAppBaseInfo = target[key].getSystemInfoSync
|
||||
}
|
||||
|
||||
if (!target[key].canIUse('getWindowInfo')) {
|
||||
target[key].getWindowInfo = target[key].getSystemInfoSync
|
||||
}
|
||||
|
||||
if (!target[key].canIUse('getDeviceInfo')) {
|
||||
target[key].getDeviceInfo = target[key].getSystemInfoSync
|
||||
}
|
||||
export default target[key]
|
||||
Reference in New Issue
Block a user