diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-context.md b/zh-cn/application-dev/reference/apis/js-apis-application-context.md index 4fa6b87cffc617ec1ed7562389fee67aa32bcced..5292c54ba36f5fe056f876c950045031420af00a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-context.md @@ -79,3 +79,37 @@ getApplicationContext(): Context; // 必选项。 let context = this.context.getApplicationContext(); ``` + + +## Context.switchArea + +switchArea(mode: AreaMode): void; + +切换需要访问的文件分区。 + +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core + +**参数:** + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | mode | [AreaMode](#areamode) | 是 | 文件分区。 | + +**示例:** + + ```js + var areaMode = 0; + this.context.switchArea(areaMode); + ``` + + +## AreaMode + +访问的文件分区,每个文件分区有对应自己的内容。 + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core + +| 变量 | 值 | 描述 | +| --------------- | ---- | --------------- | +| EL1 | 0 | 设备级加密区。 | +| EL2 | 1 | 用户凭据加密区。默认为EL2。 | \ No newline at end of file