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

fix(H5路由): 修复直接输入页面路由时路径格式不正确的问题

feige996 9 hónapja
szülő
commit
47cd19821f
1 módosított fájl, 6 hozzáadás és 1 törlés
  1. 6 1
      src/App.vue

+ 6 - 1
src/App.vue

@@ -7,7 +7,12 @@ onLaunch((options) => {
   // #ifdef H5
   // 处理H5环境用户直接输入页面路由的情况:https://github.com/unibest-tech/unibest/issues/192
   console.log('App Launch', options?.path)
-  navigateToInterceptor.invoke({ url: options?.path ?? '/' })
+  if (options?.path) {
+    navigateToInterceptor.invoke({ url: `/${options.path}` })
+  }
+  else {
+    navigateToInterceptor.invoke({ url: '/' })
+  }
   // #endif
 })
 onShow(() => {