Przeglądaj źródła

fix(router): #250 明确拦截器返回false以阻止原路由执行

修改拦截器返回值从true到false,以明确表示阻止原路由继续执行,避免潜在的逻辑混淆
feige996 8 miesięcy temu
rodzic
commit
075de5c8f6
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/router/interceptor.ts

+ 1 - 1
src/router/interceptor.ts

@@ -68,7 +68,7 @@ export const navigateToInterceptor = {
         else {
           uni.navigateTo({ url })
         }
-        return true
+        return false // 明确表示阻止原路由继续执行
       }
     }
     let fullPath = path