diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 93f77d1e01a6fb68624a5e9e9ad41c3aa4144e8f..79542a02ae6659de460c2baae6e53b2d40c69a44 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -83,18 +83,17 @@ export default class EntryAbility extends UIAbility { let context = this.context; let resourceManager: resourceManager.ResourceManager = context.resourceManager; AppStorage.setOrCreate('resourceManager', resourceManager); - windowStage.loadContent('pages/Index', (err, data) => { + windowStage.loadContent('pages/Index', (err) => { if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + hilog.error(0x0000, 'Failed to load the content. Cause: %{public}s', JSON.stringify(err.code) ?? ''); return; } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); let windowClass: window.Window = windowStage.getMainWindowSync(); let isLayoutFullScreen = true; windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => { - console.info('Succeeded in setting the window layout to full-screen mode.'); + hilog.info(0x0000, 'testTag', 'Succeeded in setting the window layout to full-screen mode.'); }).catch((err: BusinessError) => { - console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err)); + hilog.error(0x0000, 'Failed to set the window layout to full-screen mode.', JSON.stringify(err.code)); }); }); } @@ -113,4 +112,4 @@ export default class EntryAbility extends UIAbility { // Ability has back to background hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); } -} +} \ No newline at end of file