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

移除H5环境条件编译,扩展支持微信小程序分享进入等场景
This commit is contained in:
feige996
2025-08-08 09:37:36 +08:00
parent 1980595ba8
commit 27bcbb46a4

View File

@@ -4,8 +4,8 @@ import { navigateToInterceptor } from '@/router/interceptor'
import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'
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)
if (options?.path) {
navigateToInterceptor.invoke({ url: `/${options.path}` })
@@ -13,7 +13,6 @@ onLaunch((options) => {
else {
navigateToInterceptor.invoke({ url: '/' })
}
// #endif
})
onShow(() => {
console.log('App Show')