mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 13:28:38 +08:00
百度统计代码调整
This commit is contained in:
+9
-8
@@ -80,19 +80,20 @@
|
||||
<% if (htmlWebpackPlugin.options.appType == 'example') { %>
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
_hmt.push(['_requirePlugin', 'UrlChangeTracker', {
|
||||
shouldTrackUrlChange: function(newPath, oldPath) {
|
||||
return newPath && oldPath;
|
||||
}
|
||||
}]);
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
if (location.origin.includes('gitee')) {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?ba0ee7b31f404b7dc10bfcd8bdc7183d";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
}
|
||||
if (location.origin.includes('github')) {
|
||||
var hm = document.createElement("script");
|
||||
} else {
|
||||
hm.src = "https://hm.baidu.com/hm.js?d07a64f7a02cd5e9c01e1b36948ac4a5";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
}
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
@@ -189,12 +189,6 @@ router.beforeEach(async(to, from, next) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
// 百度统计代码
|
||||
if (process.env.VUE_APP_TYPE == 'example') {
|
||||
if (window._hmt) {
|
||||
window._hmt.push(['_trackPageview', location.pathname + '#' + to.fullPath])
|
||||
}
|
||||
}
|
||||
next()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user