hookehuyr

✨ feat: 新增统计埋点和百度统计

......@@ -12,5 +12,14 @@
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?20b21bb3d32d98b9a492070bd2566dfe";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>
......
/*
* @Date: 2022-07-26 09:49:54
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-11-07 16:20:26
* @LastEditTime: 2024-12-04 10:39:08
* @FilePath: /hager/src/common/mixin.js
* @Description: 文件描述
*/
import $ from 'jquery';
import { throttle } from 'lodash-es';
import axios from '@/utils/axios';
export default {
// 初始化设置
......@@ -42,6 +44,10 @@ export default {
this.top_img_height = $(window).width()*0.35 + 'px';
}
},
maEvent: throttle(function () {
var p = Array.prototype.shift.call(arguments);
return axios.post('/srv/?a=log&p=' + p)
}, 1500)
},
directives: {
clickOutside: {
......
<!--
* @Date: 2024-09-26 13:42:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-11-11 12:14:54
* @LastEditTime: 2024-12-04 10:46:22
* @FilePath: /hager/src/components/common/hagerHeader.vue
* @Description: 文件描述
-->
......@@ -356,6 +356,8 @@ export default {
path,
});
}
// TAG: 统计埋点
this.maEvent(`h_${path.slice(1)}`);
},
goToC (item) { // 跳转产品二级
this.$router.push({
......
<!--
* @Date: 2024-10-17 09:22:56
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-11-11 11:20:45
* @LastEditTime: 2024-12-04 10:47:34
* @FilePath: /hager/src/views/about/index.vue
* @Description: 文件描述
-->
......@@ -129,6 +129,8 @@ export default {
this.$router.push({
path,
});
// TAG: 统计埋点
this.maEvent(`h_${path.slice(7)}`);
}
}
}
......