dl_site_nuxt/plugins/router.js
2025-10-15 21:23:19 +08:00

18 lines
435 B
JavaScript

export default ({ app,$cookies,$config, store, $axios }) => {
app.router.beforeEach((to, from, next) => {
app.i18n.locale = store.state.locale
next()
})
app.router.afterEach((to, from) => {
if (process.client) {
let data = {
url: window.location.href,
equipment: store.state.device,
}
if (data.url && data.url !== '') {
$axios.post('/web/pageSave',data)
}
}
})
}