Browse Source

百度统计

yuwenjun1997 2 years ago
parent
commit
845bf538b8
2 changed files with 10 additions and 0 deletions
  1. 3 0
      nuxt.config.js
  2. 7 0
      static/baidu.count.js

+ 3 - 0
nuxt.config.js

@@ -20,6 +20,9 @@ export default {
     ],
     // link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
     script: [
+      {
+        src: '/baidu.count.js'
+      },
       {
         src: '/map.config.js',
       },

+ 7 - 0
static/baidu.count.js

@@ -0,0 +1,7 @@
+var _hmt = _hmt || [];
+(function() {
+  var hm = document.createElement("script");
+  hm.src = "https://hm.baidu.com/hm.js?fb2add3a2e6e9ce190f0fa752543db8a";
+  var s = document.getElementsByTagName("script")[0]; 
+  s.parentNode.insertBefore(hm, s);
+})();