From ba4446b28b8290f7cf0b79f902f6ce2e8e892bed Mon Sep 17 00:00:00 2001 From: qiang Date: Fri, 15 Nov 2019 20:53:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3uni.chooseImage?= =?UTF-8?q?=E5=9C=A8iOS=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=BD=BF=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/h5/main.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/h5/main.js b/lib/h5/main.js index 821b6b7cc..2e415d370 100644 --- a/lib/h5/main.js +++ b/lib/h5/main.js @@ -19,6 +19,17 @@ const { getCurrentPages } = require('uni-platform/service/index') +// 与微信JS-SDK同名的方法 +// const sameNameApis = ['setClipboardData', 'getClipboardData', 'onUserCaptureScreen', 'openBluetoothAdapter', 'startBluetoothDevicesDiscovery', 'onBluetoothDeviceFound', 'stopBluetoothDevicesDiscovery', 'onBluetoothAdapterStateChange', 'getConnectedBluetoothDevices', 'getBluetoothDevices', 'getBluetoothAdapterState', 'closeBluetoothAdapter', 'writeBLECharacteristicValue', 'readBLECharacteristicValue', 'onBLEConnectionStateChange', 'onBLECharacteristicValueChange', 'notifyBLECharacteristicValueChange', 'getBLEDeviceServices', 'getBLEDeviceCharacteristics', 'createBLEConnection', 'closeBLEConnection', 'onBeaconServiceChange', 'onBeaconUpdate', 'getBeacons', 'startBeaconDiscovery', 'stopBeaconDiscovery', 'chooseImage', 'previewImage', 'getNetworkType', 'onNetworkStatusChange', 'openLocation', 'getLocation'] +// 默认会被iOS企业微信替换的方法 +const sameNameApis = ['chooseImage'] +sameNameApis.forEach(item => { + Object.defineProperty(uni, item, { + writable: false, + configurable: false + }) +}) + global.uni = uni global.wx = global.uni @@ -36,4 +47,4 @@ Vue.use(require('uni-view/plugins').default, { require('uni-core/vue') require('uni-platform/components') -require('uni-components') +require('uni-components') -- GitLab