Merge branch 'master' of http://124.222.105.7:3000/dianliang/dl_site_nuxt
This commit is contained in:
commit
4fd0c298db
17
middleware/burying-point.js
Normal file
17
middleware/burying-point.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
export default async function ({
|
||||||
|
$axios,
|
||||||
|
store,
|
||||||
|
req
|
||||||
|
}) {
|
||||||
|
let userAgent = process.server ? req.headers['user-agent'] : navigator.userAgent
|
||||||
|
let url = process.server ? req.headers['referer'] : window.location.href
|
||||||
|
const isMobile = (userAgent) => {
|
||||||
|
return /Mobile|Android|iPhone|iPad|iPod|Opera Mini|IEMobile|BlackBerry|webOS/i.test(userAgent);
|
||||||
|
}
|
||||||
|
store.commit('SET_DEVICE', isMobile(userAgent))
|
||||||
|
let data = {
|
||||||
|
url: url,
|
||||||
|
equipment: store.state.device,
|
||||||
|
}
|
||||||
|
$axios.post('/web/pageSave',data)
|
||||||
|
}
|
||||||
@ -157,7 +157,7 @@ export default {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
router: {
|
router: {
|
||||||
middleware: ['i18n', 'footer', 'header']
|
middleware: ['i18n', 'footer', 'header', 'burying-point']
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
** Build configuration
|
** Build configuration
|
||||||
|
|||||||
@ -185,7 +185,8 @@ export default {
|
|||||||
company: '',
|
company: '',
|
||||||
email: '',
|
email: '',
|
||||||
tel: '',
|
tel: '',
|
||||||
content: ''
|
content: '',
|
||||||
|
equipment: this.$store.state.device
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -228,7 +228,8 @@ export default {
|
|||||||
company: '',
|
company: '',
|
||||||
email: '',
|
email: '',
|
||||||
tel: '',
|
tel: '',
|
||||||
content: ''
|
content: '',
|
||||||
|
equipment: this.$store.state.device
|
||||||
},
|
},
|
||||||
swiperOptions: {
|
swiperOptions: {
|
||||||
slidesPerView :'auto',
|
slidesPerView :'auto',
|
||||||
|
|||||||
@ -11,6 +11,7 @@ export const state = () => ({
|
|||||||
menuTree: [],
|
menuTree: [],
|
||||||
footerInfo: {},
|
footerInfo: {},
|
||||||
footerPordCategory: [],
|
footerPordCategory: [],
|
||||||
|
device: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
export const mutations = {
|
export const mutations = {
|
||||||
@ -44,6 +45,9 @@ export const mutations = {
|
|||||||
}
|
}
|
||||||
fn(tree)
|
fn(tree)
|
||||||
state.menuTree = [...state.menuTree, ...tree]
|
state.menuTree = [...state.menuTree, ...tree]
|
||||||
|
},
|
||||||
|
SET_DEVICE (state, isMob) {
|
||||||
|
state.device = isMob ? '手机端' : '电脑端'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user