From 096483a581007dcaaa2e9e7d15d5d54821da7618 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Mon, 18 Jul 2022 13:03:26 +0800 Subject: [PATCH] feat(mp-weixin): getAppAuthorizeSetting protocols --- .../mp-weixin/helpers/get-app-authorize-setting.js | 12 ++++++++++++ src/platforms/mp-weixin/runtime/api/protocols.js | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/platforms/mp-weixin/helpers/get-app-authorize-setting.js diff --git a/src/platforms/mp-weixin/helpers/get-app-authorize-setting.js b/src/platforms/mp-weixin/helpers/get-app-authorize-setting.js new file mode 100644 index 000000000..24135a76c --- /dev/null +++ b/src/platforms/mp-weixin/helpers/get-app-authorize-setting.js @@ -0,0 +1,12 @@ +export default { + returnValue: function (result) { + const { locationReducedAccuracy } = result + + result.locationAccuracy = 'unsupported' + if (locationReducedAccuracy === true) { + result.locationAccuracy = 'reduced' + } else if (locationReducedAccuracy === false) { + result.locationAccuracy = 'full' + } + } +} diff --git a/src/platforms/mp-weixin/runtime/api/protocols.js b/src/platforms/mp-weixin/runtime/api/protocols.js index c61042260..7f3a5f7a4 100644 --- a/src/platforms/mp-weixin/runtime/api/protocols.js +++ b/src/platforms/mp-weixin/runtime/api/protocols.js @@ -6,6 +6,7 @@ import showActionSheet from '../../helpers/show-action-sheet' import getAppBaseInfo from '../../helpers/get-app-base-info' import getDeviceInfo from '../../helpers/get-device-info' import getWindowInfo from '../../helpers/get-window-info' +import getAppAuthorizeSetting from '../../helpers/get-app-authorize-setting' export const protocols = { redirectTo, @@ -16,7 +17,8 @@ export const protocols = { showActionSheet, getAppBaseInfo, getDeviceInfo, - getWindowInfo + getWindowInfo, + getAppAuthorizeSetting } export const todos = [ 'vibrate', -- GitLab