完善功能
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user