Forráskód Böngészése

refactor(router): 移除H5环境下的hashchange事件监听代码

feige996 8 hónapja
szülő
commit
9725b14626
1 módosított fájl, 0 hozzáadás és 10 törlés
  1. 0 10
      src/router/interceptor.ts

+ 0 - 10
src/router/interceptor.ts

@@ -63,15 +63,5 @@ export const routeInterceptor = {
     uni.addInterceptor('reLaunch', navigateToInterceptor)
     uni.addInterceptor('redirectTo', navigateToInterceptor)
     uni.addInterceptor('switchTab', navigateToInterceptor)
-
-    // // #ifdef H5
-    // // 一个粗糙的实现方式,不满意可以自行修改:https://github.com/unibest-tech/unibest/issues/192
-    // // H5环境路由拦截,监听hashchange事件
-    // window.addEventListener('hashchange', () => {
-    //   // 获取当前路径
-    //   const currentPath = `/${window.location.hash.split('#/')[1]?.split('?')[0]}`
-    //   navigateToInterceptor.invoke({ url: currentPath })
-    // })
-    // // #endif
   },
 }