Authored by ccbikai(👎🏻🍜)

延迟加载百度统计

@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 {{#ifor localCss vue}} 46 {{#ifor localCss vue}}
47 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/{{module}}.{{page}}.css"> 47 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/{{module}}.{{page}}.css">
48 {{^}} 48 {{^}}
49 - 49 +
50 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/index.css"> 50 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/index.css">
51 {{/ifor}} 51 {{/ifor}}
52 {{^}} 52 {{^}}
@@ -61,18 +61,20 @@ @@ -61,18 +61,20 @@
61 61
62 // 非登录状态,加载百度统计 62 // 非登录状态,加载百度统计
63 if (!uid) { 63 if (!uid) {
64 - (function() {  
65 - var hm = document.createElement("script");  
66 - hm.src = "https://hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";  
67 - var s = document.getElementsByTagName("script")[0];  
68 - s.parentNode.insertBefore(hm, s);  
69 - })();  
70 - (function() {  
71 - var hm = document.createElement("script");  
72 - hm.src = "https://hm.baidu.com/hm.js?e5b83a487a4458aa5abca43f5779b764";  
73 - var s = document.getElementsByTagName("script")[0];  
74 - s.parentNode.insertBefore(hm, s);  
75 - })(); 64 + setTimeout(function() {
  65 + (function() {
  66 + var hm = document.createElement("script");
  67 + hm.src = "https://hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
  68 + var s = document.getElementsByTagName("script")[0];
  69 + s.parentNode.insertBefore(hm, s);
  70 + })();
  71 + (function() {
  72 + var hm = document.createElement("script");
  73 + hm.src = "https://hm.baidu.com/hm.js?e5b83a487a4458aa5abca43f5779b764";
  74 + var s = document.getElementsByTagName("script")[0];
  75 + s.parentNode.insertBefore(hm, s);
  76 + })();
  77 + }, 1000);
76 } 78 }
77 }()); 79 }());
78 </script> 80 </script>