完善功能

This commit is contained in:
wangxiaowei
2025-11-29 20:50:19 +08:00
parent 67c8e8e016
commit d38d4419d9
20 changed files with 403 additions and 98 deletions

View File

@ -2,17 +2,21 @@
import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
import { navigateToInterceptor } from '@/router/interceptor'
import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'
import { LOCATION_DEFAULT_CITY, LOCATION_DEFAULT_LAT, LOCATION_DEFAULT_LNG, LOCATION_LAT_KEY, LOCATION_LNG_KEY, LOCATION_CITY_KEY } from '@/hooks/useLocation'
onLaunch((options) => {
// 处理直接进入页面路由的情况如h5直接输入路由、微信小程序分享后进入等
// https://github.com/unibest-tech/unibest/issues/192
console.log('App Launch', options)
if (options?.path) {
navigateToInterceptor.invoke({ url: `/${options.path}` })
}
else {
navigateToInterceptor.invoke({ url: '/' })
}
// uni.setStorageSync(LOCATION_LAT_KEY, LOCATION_DEFAULT_LAT)
// uni.setStorageSync(LOCATION_LNG_KEY, LOCATION_DEFAULT_LNG)
// uni.setStorageSync(LOCATION_CITY_KEY, LOCATION_DEFAULT_CITY)
})
onShow((options) => {
console.log('App Show', options)