“a9d93fc6fcd388a2f86717bff7c3b7b2bb419b25”上不存在“...reference/apis/js-apis-file-environment.md”
未验证 提交 db813c84 编写于 作者: Z zengyawen 提交者: Gitee

update zh-cn/application-dev/security/accesstoken-guidelines.md.

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 a19020b9
......@@ -35,7 +35,7 @@
| name | 权限名称。 |
| reason | 当申请的权限为user_grant权限时,此字段必填,描述申请权限的原因。 |
| usedScene | 当申请的权限为user_grant权限时,此字段必填,描述权限使用的场景和时机。 |
| abilities | 标识需要使用到该权限的元能力,标签为数组形式。 |
| ability | 标识需要使用到该权限的元能力,标签为数组形式。 |
| when | 标识权限使用的时机,值为"inuse/always",表示为仅允许前台使用和前后台都可使用。 |
**示例:**
......@@ -43,12 +43,12 @@
```json
{
"module" : {
"requestPermissions":[
"reqPermissions":[
{
"name" : "ohos.permission.PERMISSION1",
"reason": "$string:reason",
"usedScene": {
"abilities": [
"ability": [
"FormAbility"
],
"when":"inuse"
......@@ -58,7 +58,7 @@
"name" : "ohos.permission.PERMISSION2",
"reason": "$string:reason",
"usedScene": {
"abilities": [
"ability": [
"FormAbility"
],
"when":"always"
......@@ -124,8 +124,7 @@
3. 根据权限校验结果采取对应的措施。
```js
//ability的onWindowStageCreate生命周期
onWindowStageCreate() {
onStart() {
var context = this.context
let array:Array<string> = ["ohos.permission.PERMISSION2"];
//requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册