From bc8528ff6aca7dd1050512665de944d54bd24760 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Thu, 2 Oct 2025 10:03:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(router):=20=E4=BF=AE=E5=A4=8Dh5=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E4=B8=8D=E8=AE=A4=E8=AF=86=20'/'=20=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/interceptor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/interceptor.ts b/src/router/interceptor.ts index 53724cb..714fea4 100644 --- a/src/router/interceptor.ts +++ b/src/router/interceptor.ts @@ -44,7 +44,7 @@ export const navigateToInterceptor = { } // 处理路由不存在的情况 - if (getAllPages().every(page => page.path !== path)) { + if (getAllPages().every(page => page.path !== path) && path !== '/') { console.warn('路由不存在:', path) uni.navigateTo({ url: NOT_FOUND_PAGE }) return false // 明确表示阻止原路由继续执行