提交 48967052 编写于 作者: Z zhouyan

访问控制ArtTS告警修复

Signed-off-by: Nzhouyan <zhouyan160@huawei.com>
Change-Id: I68e94482b4e87eaf05fbb437e60ef1a692f5bc37
上级 295273c3
......@@ -370,7 +370,7 @@
通过调用[requestPermissionsFromUser()](../reference/apis/js-apis-inner-app-context.md#contextrequestpermissionsfromuser7)接口向用户动态申请授权。
```js
```ts
import { BusinessError } from '@ohos.base';
import featureAbility from '@ohos.ability.featureAbility';
......@@ -378,7 +378,7 @@ reqPermissions() {
let context = featureAbility.getContext();
let array:Array<string> = ["ohos.permission.PERMISSION2"];
//requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗
context.requestPermissionsFromUser(array, 1).then(function(data) {
context.requestPermissionsFromUser(array, 1).then(data => {
console.log("data:" + JSON.stringify(data));
console.log("data permissions:" + JSON.stringify(data.permissions));
console.log("data result:" + JSON.stringify(data.authResults));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册