Sfoglia il codice sorgente

Auto merge main into base

GitHub Actions 6 mesi fa
parent
commit
4afd024c5a
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/router/interceptor.ts

+ 1 - 1
src/router/interceptor.ts

@@ -45,7 +45,7 @@ export const navigateToInterceptor = {
     }
 
     // 处理路由不存在的情况
-    if (getAllPages().every(page => page.path !== path) && path !== '/') {
+    if (path !== '/' && !getAllPages().some(page => page.path !== path)) {
       console.warn('路由不存在:', path)
       uni.navigateTo({ url: NOT_FOUND_PAGE })
       return false // 明确表示阻止原路由继续执行