未验证 提交 783153ac 编写于 作者: O openharmony_ci 提交者: Gitee

!21091 修复应用上下文指南中应用文件路径与实际不符的问题

Merge pull request !21091 from xuzhihao/master
...@@ -84,13 +84,13 @@ ...@@ -84,13 +84,13 @@
| 属性 | 路径 | | 属性 | 路径 |
| -------- | -------- | | -------- | -------- |
| bundleCodeDir | <路径前缀>/el1/bundle/ | | bundleCodeDir | <路径前缀>/el1/bundle |
| cacheDir | <路径前缀>/<加密等级>/base/cache/ | | cacheDir | <路径前缀>/<加密等级>/base/cache |
| filesDir | <路径前缀>/<加密等级>/base/files/ | | filesDir | <路径前缀>/<加密等级>/base/files |
| preferencesDir | <路径前缀>/<加密等级>/base/preferences/ | | preferencesDir | <路径前缀>/<加密等级>/base/preferences |
| tempDir | <路径前缀>/<加密等级>/base/temp/ | | tempDir | <路径前缀>/<加密等级>/base/temp |
| databaseDir | <路径前缀>/<加密等级>/database/ | | databaseDir | <路径前缀>/<加密等级>/database |
| distributedFilesDir | <路径前缀>/el2/distributedFiles/ | | distributedFilesDir | <路径前缀>/el2/distributedFiles |
示例代码如下所示。 示例代码如下所示。
...@@ -108,6 +108,9 @@ ...@@ -108,6 +108,9 @@
let distributedFilesDir = applicationContext.distributedFilesDir; let distributedFilesDir = applicationContext.distributedFilesDir;
let preferencesDir = applicationContext.preferencesDir; let preferencesDir = applicationContext.preferencesDir;
... ...
// 获取应用文件路径
let filePath = tempDir + 'test.txt';
console.info(`filePath: ${filePath}`);
} }
} }
``` ```
...@@ -116,13 +119,13 @@ ...@@ -116,13 +119,13 @@
| 属性 | 路径 | | 属性 | 路径 |
| -------- | -------- | | -------- | -------- |
| bundleCodeDir | <路径前缀>/el1/bundle/ | | bundleCodeDir | <路径前缀>/el1/bundle |
| cacheDir | <路径前缀>/<加密等级>/base/**haps/\<module-name>**/cache/ | | cacheDir | <路径前缀>/<加密等级>/base/**haps/\<module-name>**/cache |
| filesDir | <路径前缀>/<加密等级>/base/**haps/\<module-name>**/files/ | | filesDir | <路径前缀>/<加密等级>/base/**haps/\<module-name>**/files |
| preferencesDir | <路径前缀>/<加密等级>/base/**haps/\<module-name>**/preferences/ | | preferencesDir | <路径前缀>/<加密等级>/base/**haps/\<module-name>**/preferences |
| tempDir | <路径前缀>/<加密等级>/base/**haps/\<module-name>**/temp/ | | tempDir | <路径前缀>/<加密等级>/base/**haps/\<module-name>**/temp |
| databaseDir | <路径前缀>/<加密等级>/database/**\<module-name>**/ | | databaseDir | <路径前缀>/<加密等级>/database/**\<module-name>** |
| distributedFilesDir | <路径前缀>/el2/distributedFiles/**\<module-name>**/ | | distributedFilesDir | <路径前缀>/el2/distributedFiles/**\<module-name>** |
示例代码如下所示。 示例代码如下所示。
...@@ -139,6 +142,9 @@ ...@@ -139,6 +142,9 @@
let distributedFilesDir = this.context.distributedFilesDir; let distributedFilesDir = this.context.distributedFilesDir;
let preferencesDir = this.context.preferencesDir; let preferencesDir = this.context.preferencesDir;
... ...
// 获取应用文件路径
let filePath = tempDir + 'test.txt';
console.info(`filePath: ${filePath}`);
} }
} }
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册