提交 c74a5d5f 编写于 作者: D DCloud_LXH

feat(app): openAppAuthorizeSetting

上级 201851f3
......@@ -43,6 +43,7 @@ export * from './protocols/device/soterAuthentication'
export * from './protocols/device/scanCode'
export * from './protocols/device/getSystemSetting'
export * from './protocols/device/getAppAuthorizeSetting'
export * from './protocols/device/openAppAuthorizeSetting'
export * from './protocols/storage/storage'
......
export const API_OPEN_APP_AUTHORIZE_SETTING = 'openAppAuthorizeSetting'
export type API_TYPE_OPEN_APP_AUTHORIZE_SETTING =
typeof uni.openAppAuthorizeSetting
import {
API_OPEN_APP_AUTHORIZE_SETTING,
API_TYPE_OPEN_APP_AUTHORIZE_SETTING,
defineAsyncApi,
} from '@dcloudio/uni-api'
type OpenAppAuthorizeSetting = (
cb: (res: { type: string; code: number }) => void
) => void
export const openAppAuthorizeSetting =
defineAsyncApi<API_TYPE_OPEN_APP_AUTHORIZE_SETTING>(
API_OPEN_APP_AUTHORIZE_SETTING,
(_, { resolve, reject }) => {
const { openAppAuthorizeSetting } = weex.requireModule('plus')
const fn = openAppAuthorizeSetting as OpenAppAuthorizeSetting
fn((ret) => {
if (ret.type === 'success') {
resolve()
} else {
reject()
}
})
}
)
......@@ -26,6 +26,7 @@ export * from './device/brightness'
export * from './device/getWindowInfo'
export * from './device/getSystemSetting'
export * from './device/getAppAuthorizeSetting'
export * from './device/openAppAuthorizeSetting'
export * from './media/getImageInfo'
export * from './media/getVideoInfo'
......
......@@ -6,7 +6,7 @@ importers:
specifiers:
'@babel/core': ^7.17.10
'@babel/preset-env': ^7.16.11
'@dcloudio/types': ^3.0.10
'@dcloudio/types': ^3.0.11
'@dcloudio/uni-api': 3.0.0-alpha-3050220220719003
'@dcloudio/uni-app': 3.0.0-alpha-3050220220719003
'@jest/types': ^27.0.2
......@@ -57,7 +57,7 @@ importers:
devDependencies:
'@babel/core': 7.18.5
'@babel/preset-env': 7.18.2_@babel+core@7.18.5
'@dcloudio/types': 3.0.10
'@dcloudio/types': 3.0.11
'@dcloudio/uni-api': link:packages/uni-api
'@dcloudio/uni-app': link:packages/uni-app
'@jest/types': 27.5.1
......@@ -2137,8 +2137,8 @@ packages:
resolution: {integrity: sha512-mrCMwcINy1IFjU9VUqLeWBkj404yWs5paLDttBcA+eqUjanuUQbBcTVPqlrGgkyzLXDcV2oDDZRSNxNpXi4kMQ==}
dev: true
/@dcloudio/types/3.0.10:
resolution: {integrity: sha512-FPffL88ogSqYeobvV0v7F9qYoMJajMfpILCipKHyO73DLSNbWNAbuDg+4tif+qMFeFRroKdLIkKOiYJT5oLSng==}
/@dcloudio/types/3.0.11:
resolution: {integrity: sha512-ggXrnqpROuLwubjp5/IZvGd4f8l6MsXGPzU45WoQ4UGStxpStwnu3dDgdLgXJMyWnGPZetcsjl+hcQrD7mjAiw==}
dev: true
/@dcloudio/uni-cli-i18n/2.0.0-alpha-33020211130001:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册