mirror of
https://github.com/ZiuChen/ZiuChen.github.io.git
synced 2025-08-17 23:19:55 +08:00
fix: 本地调试环境下不执行埋点上报
This commit is contained in:
parent
e96ac7009a
commit
3c6f1183c2
@ -9,12 +9,14 @@ module.exports = {
|
||||
/* js */ `
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var isDev = document.location.href.indexOf("localhost") !== -1
|
||||
var isGitee = document.location.href.indexOf("gitee.io") !== -1
|
||||
var hm1 = document.createElement("script");
|
||||
hm1.src = "https://hm.baidu.com/hm.js?08b4ef50a9244e83e5a1bd5822442829"; // gitee
|
||||
var hm2 = document.createElement("script");
|
||||
hm2.src = "https://hm.baidu.com/hm.js?50bac15a1f238d1aa61f104a5fb6f5e0"; // github
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
if(isDev) return // 不上报
|
||||
if (isGitee) s.parentNode.insertBefore(hm1, s);
|
||||
else s.parentNode.insertBefore(hm2, s);
|
||||
})();
|
||||
|
Loading…
x
Reference in New Issue
Block a user