feat:优化 vben + antd 百度统计的实现

This commit is contained in:
YunaiV
2025-04-19 16:41:49 +08:00
parent 4ccda9a5a1
commit 97d20d627b
4 changed files with 40 additions and 4 deletions

View File

@@ -15,13 +15,13 @@
<title><%= VITE_APP_TITLE %></title>
<link rel="icon" href="/favicon.ico" />
<script>
// 生产环境下注入百度统计
if (window._VBEN_ADMIN_PRO_APP_CONF_) {
var HM_ID = '<%= VITE_APP_BAIDU_CODE %>'
if (HM_ID) {
var _hmt = _hmt || [];
(function () {
var hm = document.createElement('script');
hm.src =
'https://hm.baidu.com/hm.js?b38e689f40558f20a9a686d7f6f33edf';
'https://hm.baidu.com/hm.js?' + HM_ID;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s);
})();