|
@@ -1,13 +1,21 @@
|
|
|
;(function() {
|
|
|
var host = location.host
|
|
|
var hm = document.createElement("script");
|
|
|
+ // 去除query后的location
|
|
|
+ var uLocation = location.host + location.pathname
|
|
|
var patterns = {
|
|
|
ip: /((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/g,
|
|
|
- testServer: /jianyu360\.cn$/g
|
|
|
+ productionMain: /jianyu360\.cn$/g, // 主站
|
|
|
+ pcCMS: /jianyu360\.cn\/jycms/g, // pcCMS
|
|
|
}
|
|
|
- if (patterns.ip.test(host) || patterns.testServer.test(host)) {
|
|
|
+ if (patterns.pcCMS.test(uLocation)) {
|
|
|
+ // 剑鱼PC端CMS专用百度统计
|
|
|
+ hm.src = "https://hm.baidu.com/hm.js?32344152a6d39fdf42b2a171d0a8eab7";
|
|
|
+ } else if (patterns.productionMain.test(host)) {
|
|
|
+ // 主站百度统计
|
|
|
hm.src = "https://hm.baidu.com/hm.js?52c42de35032567eb9d7a24a43c84bda";
|
|
|
} else {
|
|
|
+ // 测试环境和其他百度统计
|
|
|
hm.src = "https://hm.baidu.com/hm.js?72331746d85dcac3dac65202d103e5d9";
|
|
|
}
|
|
|
setTimeout(function(){
|