소스 검색

feat: 路由拦截全部加上

Burt 1 년 전
부모
커밋
c47eb87132
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/interceptors/route.ts

+ 3 - 1
src/interceptors/route.ts

@@ -5,7 +5,7 @@
  * 我这里应为大部分都可以随便进入,所以使用黑名单
  * 我这里应为大部分都可以随便进入,所以使用黑名单
  */
  */
 import { useUserStore } from '@/store'
 import { useUserStore } from '@/store'
-import { getNeedLoginPages, needLoginPages as _needLoginPages } from '@/utils'
+import { needLoginPages as _needLoginPages, getNeedLoginPages } from '@/utils'
 
 
 // TODO Check
 // TODO Check
 const loginRoute = '/pages/login/index'
 const loginRoute = '/pages/login/index'
@@ -49,5 +49,7 @@ export const routeInterceptor = {
     uni.addInterceptor('navigateTo', navigateToInterceptor)
     uni.addInterceptor('navigateTo', navigateToInterceptor)
     uni.addInterceptor('reLaunch', navigateToInterceptor)
     uni.addInterceptor('reLaunch', navigateToInterceptor)
     uni.addInterceptor('redirectTo', navigateToInterceptor)
     uni.addInterceptor('redirectTo', navigateToInterceptor)
+    uni.addInterceptor('navigateBack', navigateToInterceptor)
+    uni.addInterceptor('switchTab', navigateToInterceptor)
   },
   },
 }
 }