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