From f3d806e78f6313da6aa3908b4b818087d486a33a Mon Sep 17 00:00:00 2001 From: yuandongping Date: Thu, 5 Jun 2025 16:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=AF=E5=8A=A8vpnExt?= =?UTF-8?q?=E6=8C=89=E9=94=AE=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuandongping --- .../Connectivity/VPN/entry/src/main/ets/pages/StartVpn.ets | 3 +++ .../Connectivity/VPN/entry/src/main/ets/pages/StopVpn.ets | 4 ++++ .../VPN/entry/src/main/resources/en_US/element/string.json | 2 +- .../VPN/entry/src/main/resources/zh_CN/element/string.json | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/code/BasicFeature/Connectivity/VPN/entry/src/main/ets/pages/StartVpn.ets b/code/BasicFeature/Connectivity/VPN/entry/src/main/ets/pages/StartVpn.ets index 8952dfeaf3..8a0f839466 100644 --- a/code/BasicFeature/Connectivity/VPN/entry/src/main/ets/pages/StartVpn.ets +++ b/code/BasicFeature/Connectivity/VPN/entry/src/main/ets/pages/StartVpn.ets @@ -170,6 +170,9 @@ struct StartVpn { vpnext.startVpnExtensionAbility(want).then(() => { showToast('start vpnExt Success', 2000); hilog.info(0x0000, 'developTag', '%{public}s', 'start vpnExt Success'); + }).catch((err: BusinessError) => { + showToast('start vpnExt Fail', 2000); + hilog.error(0x0000, 'developTag', 'start vpnExt Fail %{public}s', JSON.stringify(err) ?? ''); }) } catch (err) { showToast('start vpnExt Fail: ' + JSON.stringify(err), 2000); diff --git a/code/BasicFeature/Connectivity/VPN/entry/src/main/ets/pages/StopVpn.ets b/code/BasicFeature/Connectivity/VPN/entry/src/main/ets/pages/StopVpn.ets index dfae42ccbd..17e78e66f2 100644 --- a/code/BasicFeature/Connectivity/VPN/entry/src/main/ets/pages/StopVpn.ets +++ b/code/BasicFeature/Connectivity/VPN/entry/src/main/ets/pages/StopVpn.ets @@ -19,6 +19,7 @@ import Want from '@ohos.app.ability.Want'; import common from '@ohos.app.ability.common'; import vpn_client from "libvpn_client.so"; import { showToast } from '../components/ShowToast'; +import { BusinessError } from '@kit.BasicServicesKit'; let want: Want = { deviceId: "", @@ -68,6 +69,9 @@ struct StopVpn { vpnext.stopVpnExtensionAbility(want).then(() => { showToast('stop vpnExt Success', 2000); hilog.info(0x0000, 'developTag', '%{public}s', 'stop vpnExt Success'); + }).catch((err: BusinessError) => { + showToast('stop vpnExt Fail: ' + JSON.stringify(err), 2000); + hilog.error(0x0000, 'developTag', 'stop vpnExt Fail %{public}s', JSON.stringify(err) ?? ''); }) } catch (err) { showToast('stop vpnExt Fail: ' + JSON.stringify(err), 2000); diff --git a/code/BasicFeature/Connectivity/VPN/entry/src/main/resources/en_US/element/string.json b/code/BasicFeature/Connectivity/VPN/entry/src/main/resources/en_US/element/string.json index c50c4c2c0d..02ef7dfd95 100644 --- a/code/BasicFeature/Connectivity/VPN/entry/src/main/resources/en_US/element/string.json +++ b/code/BasicFeature/Connectivity/VPN/entry/src/main/resources/en_US/element/string.json @@ -10,7 +10,7 @@ }, { "name": "EntryAbility_label", - "value": "label" + "value": "VPN" }, { "name": "btn_create_tunnel", diff --git a/code/BasicFeature/Connectivity/VPN/entry/src/main/resources/zh_CN/element/string.json b/code/BasicFeature/Connectivity/VPN/entry/src/main/resources/zh_CN/element/string.json index 19a14d7711..31ee4b0488 100644 --- a/code/BasicFeature/Connectivity/VPN/entry/src/main/resources/zh_CN/element/string.json +++ b/code/BasicFeature/Connectivity/VPN/entry/src/main/resources/zh_CN/element/string.json @@ -10,7 +10,7 @@ }, { "name": "EntryAbility_label", - "value": "label" + "value": "VPN" }, { "name": "btn_create_tunnel", -- Gitee