diff --git a/zh-cn/application-dev/reference/apis/js-apis-file-hash.md b/zh-cn/application-dev/reference/apis/js-apis-file-hash.md index a38e3189c58e52af35f5dae9a9ab3a7d136c1a7a..911dac45c0fa4c0496587f491cf8f653872ac760 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-file-hash.md +++ b/zh-cn/application-dev/reference/apis/js-apis-file-hash.md @@ -92,6 +92,7 @@ hash(path: string, algorithm: string, callback: AsyncCallback<string>): vo **示例:** ```js + let filePath = pathDir + "/test.txt"; Hash.hash(filePath, "sha256", (err, str) => { if (err) { console.info("calculate file hash failed with error message: " + err.message + ", error code: " + err.code); diff --git a/zh-cn/application-dev/reference/apis/js-apis-hichecker.md b/zh-cn/application-dev/reference/apis/js-apis-hichecker.md index 93c400c740ac864e64e7c65119e5fbde8e1ea693..b66101c41937973184db2f07fdbb06184173d37e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hichecker.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hichecker.md @@ -46,11 +46,11 @@ addCheckRule(rule: bigint): void ```js try { // 添加一条规则 - hichecker.addCheckRule(hichecker.RULE_CAUTION_PRINT_LOG);} + hichecker.addCheckRule(hichecker.RULE_CAUTION_PRINT_LOG); // 添加多条规则 - hichecker.addCheckRule( - hichecker.RULE_CAUTION_PRINT_LOG | hichecker.RULE_CAUTION_TRIGGER_CRASH); -catch (err) { + // hichecker.addCheckRule( + // hichecker.RULE_CAUTION_PRINT_LOG | hichecker.RULE_CAUTION_TRIGGER_CRASH); +} catch (err) { console.error(`code: ${err.code}, message: ${err.message}`); } ``` @@ -76,9 +76,9 @@ try { // 删除一条规则 hichecker.removeCheckRule(hichecker.RULE_CAUTION_PRINT_LOG); // 删除多条规则 - hichecker.removeCheckRule( - hichecker.RULE_CAUTION_PRINT_LOG | hichecker.RULE_CAUTION_TRIGGER_CRASH); -catch (err) { + // hichecker.removeCheckRule( + // hichecker.RULE_CAUTION_PRINT_LOG | hichecker.RULE_CAUTION_TRIGGER_CRASH); +} catch (err) { console.error(`code: ${err.code}, message: ${err.message}`); } ``` @@ -113,7 +113,7 @@ try { // 查询是否包含 hichecker.containsCheckRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // return true; hichecker.containsCheckRule(hichecker.RULE_CAUTION_PRINT_LOG); // return false; -catch (err) { +} catch (err) { console.error(`code: ${err.code}, message: ${err.message}`); } ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-hidebug.md b/zh-cn/application-dev/reference/apis/js-apis-hidebug.md index 72e7c8ffa90f0f1aafb8685973b196dbb62e7ab1..66306729dc0da5f124d69eb0f9865c17b4259048 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hidebug.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hidebug.md @@ -297,7 +297,7 @@ import hidebug from '@ohos.hidebug' try { hidebug.startJsCpuProfiling("cpu_profiling"); - ... + // ... hidebug.stopJsCpuProfiling(); } catch (error) { console.info(error.code) @@ -326,7 +326,7 @@ import hidebug from '@ohos.hidebug' try { hidebug.startJsCpuProfiling("cpu_profiling"); - ... + // ... hidebug.stopJsCpuProfiling(); } catch (error) { console.info(error.code)