From 39c4e75de51c7a462b05d3791b62d68fcb3ce46f Mon Sep 17 00:00:00 2001 From: zoujing Date: Thu, 16 Jul 2026 21:16:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B7=AF=E7=94=B1=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 0f07657..e1f9546 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -15,7 +15,15 @@ export function navigateTo(url, args) { } } console.log("Navigating to URL:", targetUrl); - uni.navigateTo({ - url: "/pages/webview/index?url=" + encodeURIComponent(targetUrl), - }); + if (url.startsWith("http://") || url.startsWith("https://")) { + // 如果是外部链接,使用webview打开 + uni.navigateTo({ + url: "/pages/webview/index?url=" + encodeURIComponent(targetUrl), + }); + } else { + // 否则,直接跳转到内部页面 + uni.navigateTo({ + url: targetUrl, + }); + } }