diff --git a/entry/src/main/ets/common/BreakpointSystem.ets b/entry/src/main/ets/common/BreakpointSystem.ets index af587b32cc16a7e7b36201ef1c574dd3d56dd0e4..2fe9c5213aacde5ebd67fe16f7c7bee2972f54f3 100644 --- a/entry/src/main/ets/common/BreakpointSystem.ets +++ b/entry/src/main/ets/common/BreakpointSystem.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/common/Constants.ets b/entry/src/main/ets/common/Constants.ets index 093e1e2705a99b061d20bbcf390fa49ec3e98f5a..49c8670933d61ca597ceb40e6928dabe89499993 100644 --- a/entry/src/main/ets/common/Constants.ets +++ b/entry/src/main/ets/common/Constants.ets @@ -14,16 +14,6 @@ */ export class Constants { - /** - * Text border radius. - */ - public static readonly TEXT_BORDER_RADIUS: number = 16; - - /** - * Background color. - */ - public static readonly BACK_COLOR: string = '#F1F3F5'; - /** * All breakpoints */ diff --git a/entry/src/main/ets/common/ResourceUtil.ets b/entry/src/main/ets/common/ResourceUtil.ets index c7472008966190c5671b30374ad06eb2e4e51509..9709127e94b6e164806eae81faf18ffb5ae9eba6 100644 --- a/entry/src/main/ets/common/ResourceUtil.ets +++ b/entry/src/main/ets/common/ResourceUtil.ets @@ -13,6 +13,7 @@ * limitations under the License. */ +import { hilog } from '@kit.PerformanceAnalysisKit'; import { JSON, util } from '@kit.ArkTS'; export class ResourceUtil { @@ -29,6 +30,7 @@ export class ResourceUtil { try { resourceString = context.resourceManager.getStringSync(resource.id); } catch (error) { + hilog.error(0x0000, 'WebviewController', '%{public}s', `error: ${error}`); } return resourceString; } diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 39b4f275447293a54566ec114565cff8398f9b11..4f3cf04372fbb2f75d6f5489eb91978449c2da53 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -41,7 +41,7 @@ export default class EntryAbility extends UIAbility { AppStorage.setOrCreate('currentBreakpoint', this.curBp); } } catch (error) { - hilog.info(0x0000, 'updateBreakpoint', '%{public}s', `updateBreakpoint fail, err: ${JSON.stringify(error)}`); + hilog.error(0x0000, 'updateBreakpoint', '%{public}s', `updateBreakpoint fail, err: ${JSON.stringify(error)}`); } } @@ -96,9 +96,10 @@ export default class EntryAbility extends UIAbility { 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', '%{public}s', '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, 'testTag', '%{public}s', + `Failed to set the window layout to full-screen mode. Cause:${err}`); }); }); } diff --git a/entry/src/main/ets/pages/WebPage.ets b/entry/src/main/ets/pages/WebPage.ets index 66193982c310d5346c9455db5b6e2bc2d0297464..29cbf393dccf312434e64fc6448effc0a5ffd651 100644 --- a/entry/src/main/ets/pages/WebPage.ets +++ b/entry/src/main/ets/pages/WebPage.ets @@ -14,7 +14,6 @@ */ import { UIContext, NodeController, BuilderNode, FrameNode } from '@kit.ArkUI'; -import { BusinessError } from '@kit.BasicServicesKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { common } from '@kit.AbilityKit'; import { webview } from '@kit.ArkWeb'; @@ -36,10 +35,14 @@ function webBuilder(data: Data) { // Set the whitelist to allow access to only the trust web page. data.controller.setUrlTrustList(Constants.URL_TRUST); } catch (error) { - hilog.info(0x0000, 'WebviewController', '%{public}s', - `ErrorCode: ${(error as BusinessError).code}, Message: ${(error as BusinessError).message}`); + hilog.error(0x0000, 'WebviewController', '%{public}s', `error: ${error}`); } }) + .onSslErrorEventReceive((event) => { + hilog.info(0x0000, 'onSslErrorEventReceive', '%{public}s', + `ssl check failed, error is :${event.error.toString()}`); + event.handler.handleCancel(); + }) .width($r('app.string.full_height_width')) .height($r('app.string.full_height_width')) .domStorageAccess(true)