From c763ab97070053bbc6335fec96b76f2367e20202 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Sat, 19 Jul 2025 11:50:30 +0000 Subject: [PATCH 1/2] update wifi/application/portal_login/entry/src/main/ets/pages/Index.ets. Signed-off-by: chen yi wen <15068825070@163.com> --- .../portal_login/entry/src/main/ets/pages/Index.ets | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wifi/application/portal_login/entry/src/main/ets/pages/Index.ets b/wifi/application/portal_login/entry/src/main/ets/pages/Index.ets index e52b5da5e..4de38b227 100644 --- a/wifi/application/portal_login/entry/src/main/ets/pages/Index.ets +++ b/wifi/application/portal_login/entry/src/main/ets/pages/Index.ets @@ -304,6 +304,19 @@ struct Index { .fileAccess(false) .geolocationAccess(false) .domStorageAccess(true) + .onOverrideUrlLoading((request) => { + const url = request.getRequestUrl(); + if (!url.startsWith('http') && !url.startsWith('https')) { + (this.getUIContext().getHostContext() as common.UIAbilityContext).openLink(url) + .then(() => { + hilog.info(DOMAIN, 'testTag', 'open link success.'); + }).catch((err: BusinessError) => { + hilog.error(DOMAIN, 'testTag', `open link failed. Code is ${err.code}, message is ${err.message}`); + }) + return true; + } + return false; + }) .onConsole((event) => { return true; }) -- Gitee From afb57b5b6fb39c173bfd636e94b068ad02b45968 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Sat, 19 Jul 2025 11:52:20 +0000 Subject: [PATCH 2/2] update wifi/application/portal_login/entry/src/main/ets/pages/Index.ets. Signed-off-by: chen yi wen <15068825070@163.com> --- .../portal_login/entry/src/main/ets/pages/Index.ets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wifi/application/portal_login/entry/src/main/ets/pages/Index.ets b/wifi/application/portal_login/entry/src/main/ets/pages/Index.ets index 4de38b227..aa72237c8 100644 --- a/wifi/application/portal_login/entry/src/main/ets/pages/Index.ets +++ b/wifi/application/portal_login/entry/src/main/ets/pages/Index.ets @@ -309,9 +309,9 @@ struct Index { if (!url.startsWith('http') && !url.startsWith('https')) { (this.getUIContext().getHostContext() as common.UIAbilityContext).openLink(url) .then(() => { - hilog.info(DOMAIN, 'testTag', 'open link success.'); + hilog.info(DOMAIN, TAG, 'open link success.'); }).catch((err: BusinessError) => { - hilog.error(DOMAIN, 'testTag', `open link failed. Code is ${err.code}, message is ${err.message}`); + hilog.error(DOMAIN, TAG, `open link failed. Code is ${err.code}, message is ${err.message}`); }) return true; } -- Gitee