onLaunch 当uni-app 初始化完成时触发(全局只触发一次)
onLaunch() {
// 第一次进入系统,由于Router插件不能拦截,由以下实现登录鉴权
if(window.performance.navigation.type === 0) {
// performance.navigation.type = 0 表示用户不是刷新操作(刷新操作 = 1)
// routerBefore(this.$Route as totalNextRoute, this.$Route as totalNextRoute);
this.$Router.replace({ path: this.$Route.path, query: this.$Router.query})
}
console.log('App Launch')
}