From d11ea34fb5e44490c73d46e0a61ba030cdd2d116 Mon Sep 17 00:00:00 2001 From: xuzhihao Date: Wed, 19 Jul 2023 15:55:41 +0800 Subject: [PATCH] =?UTF-8?q?BugFix:=20=E4=BF=AE=E5=A4=8D=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E6=96=87=E6=8C=87=E5=8D=97=E4=B8=AD=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E4=B8=8E=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E4=B8=8D=E7=AC=A6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuzhihao --- .../application-context-stage.md | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/zh-cn/application-dev/application-models/application-context-stage.md b/zh-cn/application-dev/application-models/application-context-stage.md index 6e64c5a4a5..c380d23e0b 100644 --- a/zh-cn/application-dev/application-models/application-context-stage.md +++ b/zh-cn/application-dev/application-models/application-context-stage.md @@ -84,13 +84,13 @@ | 属性 | 路径 | | -------- | -------- | - | bundleCodeDir | <路径前缀>/el1/bundle/ | - | cacheDir | <路径前缀>/<加密等级>/base/cache/ | - | filesDir | <路径前缀>/<加密等级>/base/files/ | - | preferencesDir | <路径前缀>/<加密等级>/base/preferences/ | - | tempDir | <路径前缀>/<加密等级>/base/temp/ | - | databaseDir | <路径前缀>/<加密等级>/database/ | - | distributedFilesDir | <路径前缀>/el2/distributedFiles/ | + | bundleCodeDir | <路径前缀>/el1/bundle | + | cacheDir | <路径前缀>/<加密等级>/base/cache | + | filesDir | <路径前缀>/<加密等级>/base/files | + | preferencesDir | <路径前缀>/<加密等级>/base/preferences | + | tempDir | <路径前缀>/<加密等级>/base/temp | + | databaseDir | <路径前缀>/<加密等级>/database | + | distributedFilesDir | <路径前缀>/el2/distributedFiles | 示例代码如下所示。 @@ -108,6 +108,9 @@ let distributedFilesDir = applicationContext.distributedFilesDir; let preferencesDir = applicationContext.preferencesDir; ... + // 获取应用文件路径 + let filePath = tempDir + 'test.txt'; + console.info(`filePath: ${filePath}`); } } ``` @@ -116,13 +119,13 @@ | 属性 | 路径 | | -------- | -------- | - | bundleCodeDir | <路径前缀>/el1/bundle/ | - | cacheDir | <路径前缀>/<加密等级>/base/**haps/\**/cache/ | - | filesDir | <路径前缀>/<加密等级>/base/**haps/\**/files/ | - | preferencesDir | <路径前缀>/<加密等级>/base/**haps/\**/preferences/ | - | tempDir | <路径前缀>/<加密等级>/base/**haps/\**/temp/ | - | databaseDir | <路径前缀>/<加密等级>/database/**\**/ | - | distributedFilesDir | <路径前缀>/el2/distributedFiles/**\**/ | + | bundleCodeDir | <路径前缀>/el1/bundle | + | cacheDir | <路径前缀>/<加密等级>/base/**haps/\**/cache | + | filesDir | <路径前缀>/<加密等级>/base/**haps/\**/files | + | preferencesDir | <路径前缀>/<加密等级>/base/**haps/\**/preferences | + | tempDir | <路径前缀>/<加密等级>/base/**haps/\**/temp | + | databaseDir | <路径前缀>/<加密等级>/database/**\** | + | distributedFilesDir | <路径前缀>/el2/distributedFiles/**\** | 示例代码如下所示。 @@ -139,6 +142,9 @@ let distributedFilesDir = this.context.distributedFilesDir; let preferencesDir = this.context.preferencesDir; ... + // 获取应用文件路径 + let filePath = tempDir + 'test.txt'; + console.info(`filePath: ${filePath}`); } } ``` -- GitLab