From 23324615708f721da2dc9d033d506f424d369003 Mon Sep 17 00:00:00 2001 From: kdletters Date: Sat, 20 Jun 2026 14:51:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=A1=8C=E9=9D=A2=E5=A3=B3?= =?UTF-8?q?=E5=A4=96=E9=93=BE=E5=A4=B1=E8=B4=A5=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 桌面壳外链打开失败返回与移动壳一致的稳定错误 桌面壳配置检查锁定外链失败错误口径 --- apps/desktop-shell/scripts/check-config.mjs | 2 +- .../desktop-shell/src-tauri/src/host_bridge/navigation.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/desktop-shell/scripts/check-config.mjs b/apps/desktop-shell/scripts/check-config.mjs index 575f89921..b8bcc3e8d 100644 --- a/apps/desktop-shell/scripts/check-config.mjs +++ b/apps/desktop-shell/scripts/check-config.mjs @@ -1886,7 +1886,7 @@ for (const snippet of [ 'normalize_external_url', 'open_normalized_desktop_external_url(app, url)', 'desktop_external_url_request_accepts_only_safe_system_protocols', - '"external url unavailable"', + '"external URL cannot be opened"', 'external_url_unavailable_response_is_stable', 'open_desktop_host_bridge_native_page', 'native_page_unavailable_response', diff --git a/apps/desktop-shell/src-tauri/src/host_bridge/navigation.rs b/apps/desktop-shell/src-tauri/src/host_bridge/navigation.rs index 24d536b1e..cb0ea4dcb 100644 --- a/apps/desktop-shell/src-tauri/src/host_bridge/navigation.rs +++ b/apps/desktop-shell/src-tauri/src/host_bridge/navigation.rs @@ -53,7 +53,11 @@ pub(crate) fn open_desktop_host_bridge_external_url( } fn external_url_unavailable_response(request: &HostBridgeRequest) -> HostBridgeResponse { - failed(request.id.clone(), "host_error", "external url unavailable") + failed( + request.id.clone(), + "host_error", + "external URL cannot be opened", + ) } pub(crate) fn open_desktop_host_bridge_native_page( @@ -128,7 +132,7 @@ mod tests { assert!(!response.ok); let error = response.error.expect("external url error"); assert_eq!(error.code, "host_error"); - assert_eq!(error.message, "external url unavailable"); + assert_eq!(error.message, "external URL cannot be opened"); } #[test]