diff --git a/.env b/.env
index 57bfc6b7..5f9b194b 100644
--- a/.env
+++ b/.env
@@ -13,3 +13,5 @@ VITE_GLOB_APP_TENANT_ENABLE = true
# 验证码的开关
VITE_GLOB_APP_CAPTCHA_ENABLE = true
+# 百度统计
+VITE_APP_BAIDU_CODE = eb21166668bf766b9d059a6fd1c10777
diff --git a/.env.development b/.env.development
index 9c8ba136..1eb7327e 100644
--- a/.env.development
+++ b/.env.development
@@ -23,3 +23,6 @@ VITE_GLOB_UPLOAD_URL = /upload
# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换
VITE_GLOB_API_URL_PREFIX =
+
+# 百度统计
+VITE_APP_BAIDU_CODE = eb21166668bf766b9d059a6fd1c10777
diff --git a/.env.front b/.env.front
index 699b32c9..f4506bce 100644
--- a/.env.front
+++ b/.env.front
@@ -23,3 +23,6 @@ VITE_GLOB_UPLOAD_URL = /upload
# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换
VITE_GLOB_API_URL_PREFIX =
+
+# 百度统计
+VITE_APP_BAIDU_CODE = eb21166668bf766b9d059a6fd1c10777
diff --git a/.env.production b/.env.production
index 704af928..8dd383c4 100644
--- a/.env.production
+++ b/.env.production
@@ -20,7 +20,10 @@ VITE_GLOB_API_URL = /admin-api
VITE_GLOB_UPLOAD_URL = /upload
# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换
-VITE_GLOB_API_URL_PREFIX =
+VITE_GLOB_API_URL_PREFIX =
# 打包是否开启pwa功能
VITE_USE_PWA = false
+
+# 百度统计
+VITE_APP_BAIDU_CODE = eb21166668bf766b9d059a6fd1c10777
diff --git a/.env.test b/.env.test
index d9bc0a9c..f58e65a3 100644
--- a/.env.test
+++ b/.env.test
@@ -21,7 +21,10 @@ VITE_GLOB_API_URL = /admin-api
VITE_GLOB_UPLOAD_URL = /upload
# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换
-VITE_GLOB_API_URL_PREFIX =
+VITE_GLOB_API_URL_PREFIX =
# 打包是否开启pwa功能
VITE_USE_PWA = false
+
+# 百度统计
+VITE_APP_BAIDU_CODE = eb21166668bf766b9d059a6fd1c10777
diff --git a/src/main.ts b/src/main.ts
index fea3be6f..159c9ceb 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -21,6 +21,8 @@ if (isDevMode()) {
import('ant-design-vue/dist/antd.less')
}
+import '@/utils/tongji' // 百度统计
+
async function bootstrap() {
const app = createApp(App)
diff --git a/src/utils/tongji.ts b/src/utils/tongji.ts
new file mode 100644
index 00000000..c912a850
--- /dev/null
+++ b/src/utils/tongji.ts
@@ -0,0 +1,23 @@
+import { router } from '@/router'
+
+// 用于 router push
+window._hmt = window._hmt || []
+// HM_ID
+const HM_ID = import.meta.env.VITE_APP_BAIDU_CODE
+;(function () {
+ // 有值的时候,才开启
+ if (!HM_ID) {
+ return
+ }
+ const hm = document.createElement('script')
+ hm.src = 'https://hm.baidu.com/hm.js?' + HM_ID
+ const s = document.getElementsByTagName('script')[0]
+ s.parentNode.insertBefore(hm, s)
+})()
+
+router.afterEach(function (to) {
+ if (!HM_ID) {
+ return
+ }
+ _hmt.push(['_trackPageview', to.fullPath])
+})
diff --git a/src/views/base/login/LoginForm.vue b/src/views/base/login/LoginForm.vue
index aff968fa..35f54fd9 100644
--- a/src/views/base/login/LoginForm.vue
+++ b/src/views/base/login/LoginForm.vue
@@ -68,8 +68,17 @@