Просмотр исходного кода

feat(路由): 统一处理直接进入页面路由的情况

移除H5环境条件编译,扩展支持微信小程序分享进入等场景
feige996 8 месяцев назад
Родитель
Сommit
27bcbb46a4
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      src/App.vue

+ 2 - 3
src/App.vue

@@ -4,8 +4,8 @@ import { navigateToInterceptor } from '@/router/interceptor'
 import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'
 import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'
 
 
 onLaunch((options) => {
 onLaunch((options) => {
-  // #ifdef H5
-  // 处理H5环境用户直接输入页面路由的情况:https://github.com/unibest-tech/unibest/issues/192
+  // 处理直接进入页面路由的情况:如h5直接输入路由、微信小程序分享后进入等
+  // https://github.com/unibest-tech/unibest/issues/192
   console.log('App Launch', options?.path)
   console.log('App Launch', options?.path)
   if (options?.path) {
   if (options?.path) {
     navigateToInterceptor.invoke({ url: `/${options.path}` })
     navigateToInterceptor.invoke({ url: `/${options.path}` })
@@ -13,7 +13,6 @@ onLaunch((options) => {
   else {
   else {
     navigateToInterceptor.invoke({ url: '/' })
     navigateToInterceptor.invoke({ url: '/' })
   }
   }
-  // #endif
 })
 })
 onShow(() => {
 onShow(() => {
   console.log('App Show')
   console.log('App Show')