|
@@ -23,6 +23,9 @@ const routes = [
|
|
|
audioNode.src = require(`@/assets/audios/${globalConfig.audioName.homeView}.mp3`)
|
|
|
audioNode.play()
|
|
|
}
|
|
|
+ if (!from.name) {
|
|
|
+ globalApi.recordVisit()
|
|
|
+ }
|
|
|
next()
|
|
|
}
|
|
|
},
|
|
@@ -144,9 +147,9 @@ const router = new VueRouter({
|
|
|
routes
|
|
|
})
|
|
|
|
|
|
-// 强制每次都从首页进入
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
console.log('beforeEach: ', to, from, next)
|
|
|
+ // 强制每次都从首页进入
|
|
|
if (process.env.NODE_ENV === 'production' && !from.name && to.name !== 'HomeView' && !location.href.endsWith('autoReload=true')) {
|
|
|
next('/')
|
|
|
} else {
|