Commit d3831acf by yanju

Merge branch 'new-func#1' into 'master'

add baidu.js

See merge request pigbigbig/beyond-clouds-front!100
parents 32acef21 d1db86fa
......@@ -19,6 +19,9 @@ module.exports = {
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
],
script: [
{ src: 'https://hm.baidu.com/hm.js?8e45646333c0b122d556ae44e337c90e' }
]
},
/*
......@@ -44,6 +47,7 @@ module.exports = {
*/
plugins: [
'~/plugins/axios',
{src: '~/plugins/baidu.js'},
{src:'~/plugins/mavonEditor.js',ssr:false},
{src:'~/plugins/cropper.js',ssr:false},
{src:'~/plugins/globalBux.js',ssr:false},
......
export default ({ app: { router }, store }) => {
router.afterEach((to, from) => {
try {
document.getElementById('g_baidu') && document.getElementById('g_baidu').remove();
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?8e45646333c0b122d556ae44e337c90e";
hm.id = "g_baidu"
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
window._hmt = window._hmt || []
window._hmt.push(['_trackPageview', to.fullPath])
} catch (e) {}
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment