From f2d37c30a5ed56242da27b4a207ca7bb482f0745 Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Mon, 19 Jun 2023 17:28:25 +0800 Subject: [PATCH] feat: baidu statistic --- client/public/js/baidutongji.js | 8 ++++ client/src/pages/_app.tsx | 1 + client/src/pages/api/chat/saveChat.ts | 62 ++++++++++++++++----------- 3 files changed, 47 insertions(+), 24 deletions(-) create mode 100644 client/public/js/baidutongji.js diff --git a/client/public/js/baidutongji.js b/client/public/js/baidutongji.js new file mode 100644 index 000000000..632c5ee9c --- /dev/null +++ b/client/public/js/baidutongji.js @@ -0,0 +1,8 @@ +var _hmt = _hmt || []; + +(function () { + const hm = document.createElement('script'); + hm.src = 'https://hm.baidu.com/hm.js?a5357e9dab086658bac0b6faf148882e'; + const s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(hm, s); +})(); diff --git a/client/src/pages/_app.tsx b/client/src/pages/_app.tsx index 94672a09f..42bdefe87 100644 --- a/client/src/pages/_app.tsx +++ b/client/src/pages/_app.tsx @@ -52,6 +52,7 @@ function App({ Component, pageProps }: AppProps) { + {googleVerKey && ( <>