From 1fa8044cdb3200357f328b3e817468c63a57b657 Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Thu, 22 Dec 2022 10:03:29 +0800 Subject: [PATCH] Issue:#I671G8 Description: modify js-apis-launcherBundleManager.md Sig: SIG_ApplicaitonFramework Feature or Bugfix: Bugfix Binary Source: No Signed-off-by: SoftSquirrel --- .../apis/js-apis-launcherBundleManager.md | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-launcherBundleManager.md b/zh-cn/application-dev/reference/apis/js-apis-launcherBundleManager.md index d7b4f4a09f..08b8e4a38a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-launcherBundleManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-launcherBundleManager.md @@ -55,12 +55,13 @@ import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; try { launcherBundleManager.getLauncherAbilityInfo('com.example.demo', 100, (errData, data) => { if (errData !== null) { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); + } else { + console.log("data is " + JSON.stringify(data)); } - console.log("data is " + JSON.stringify(data)); }) } catch (errData) { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); } ``` @@ -107,10 +108,10 @@ try { launcherBundleManager.getLauncherAbilityInfo("com.example.demo", 100).then(data => { console.log("data is " + JSON.stringify(data)); }).catch (errData => { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); }) } catch (errData) { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); } ``` @@ -154,12 +155,13 @@ import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; try { launcherBundleManager.getAllLauncherAbilityInfo(100, (errData, data) => { if (errData !== null) { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); + } else { + console.log("data is " + JSON.stringify(data)); } - console.log("data is " + JSON.stringify(data)); }); } catch (errData) { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); } ``` ## launcherBundlemanager.getAllLauncherAbilityInfo9+ @@ -203,10 +205,10 @@ try { launcherBundleManager.getAllLauncherAbilityInfo(100).then(data => { console.log("data is " + JSON.stringify(data)); }).catch (errData => { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); }); } catch (errData) { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); } ``` @@ -248,12 +250,13 @@ import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; try { launcherBundleManager.getShortcutInfo("com.example.demo", (errData, data) => { if (errData !== null) { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); + } else { + console.log("data is " + JSON.stringify(data)); } - console.log("data is " + JSON.stringify(data)); }); } catch (errData) { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); } ``` @@ -296,9 +299,9 @@ try { launcherBundleManager.getShortcutInfo("com.example.demo").then(data => { console.log("data is " + JSON.stringify(data)); }).catch (errData => { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); }); } catch (errData) { - console.log(`errData is errCode:${errData.code} message:${errData.message}`); + console.error(`errData is errCode:${errData.code} message:${errData.message}`); } ``` -- GitLab