fix(router): 修复h5情况下不认识 '/' 路由

This commit is contained in:
feige996
2025-10-02 10:03:24 +08:00
parent d437b484a4
commit bc8528ff6a

View File

@@ -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 // 明确表示阻止原路由继续执行