提交 5096844c 编写于 作者: W wangkai

change1_16

Signed-off-by: Nwangkai <wangkai424@huawei.com>
上级 d285e314
......@@ -71,22 +71,22 @@
import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
function grantPermission() {
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
let context = this.context;
}
}
}
let permissions = ['ohos.permission.DISTRIBUTED_DATASYNC'];
context.requestPermissionsFromUser(permissions).then((data) => {
function grantPermission() {
let permissions = ['ohos.permission.DISTRIBUTED_DATASYNC'];
context.requestPermissionsFromUser(permissions).then((data) => {
console.log('success: ${data}');
}).catch((error) => {
}).catch((error) => {
console.log('failed: ${error}');
});
});
}
grantPermission();
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册