queryPermission
Start from API_LEVEL
3.0. Please refer to API_LEVEL.
Check the authorization status of Mini Program permissions.
Type
function queryPermission(option: Option): Result
Parameters
Option
| Property | Type | Required | DefaultValue | Description | API_LEVEL |
|---|---|---|---|---|---|
| permissions | Array<string> | Y | - | An array of permission strings, with an array length of at least 1 | 3.0 |
Result
| Type | Description |
|---|---|
Array<number> | Permissions query result array, corresponding to the order of permissions array, 0: not authorized, 1: unknown permissions, 2: authorized |
Example
import { queryPermission } from '@zos/app'
const result = queryPermission()
console.log(result)