From 2bee4ac4eff6f75e1dacfb08f4feb75a1cdc7927 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Wed, 22 Nov 2023 22:55:37 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B3=A8=E9=87=8A=E6=8E=89=20API=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vitepress/config/head.ts | 56 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/docs/.vitepress/config/head.ts b/docs/.vitepress/config/head.ts index 52a8868dc..306031cca 100644 --- a/docs/.vitepress/config/head.ts +++ b/docs/.vitepress/config/head.ts @@ -27,33 +27,33 @@ export const head: HeadConfig[] = [ s.parentNode.insertBefore(hm, s); })();`], // 页面访问量统计 - ['script', {}, ` - window.addEventListener('load', function() { - let oldHref = document.location.href, bodyDOM = document.querySelector('body'); - const observer = new MutationObserver(function(mutations) { - if (oldHref != document.location.href) { - oldHref = document.location.href; - getPv() - window.requestAnimationFrame(function() { - let tmp = document.querySelector('body'); - if(tmp != bodyDOM) { - bodyDOM = tmp; - observer.observe(bodyDOM, config); - } - }) - } - }); - const config = { - childList: true, - subtree: true - }; - observer.observe(bodyDOM, config); - getPv() - }, true); + // ['script', {}, ` + // window.addEventListener('load', function() { + // let oldHref = document.location.href, bodyDOM = document.querySelector('body'); + // const observer = new MutationObserver(function(mutations) { + // if (oldHref != document.location.href) { + // oldHref = document.location.href; + // getPv() + // window.requestAnimationFrame(function() { + // let tmp = document.querySelector('body'); + // if(tmp != bodyDOM) { + // bodyDOM = tmp; + // observer.observe(bodyDOM, config); + // } + // }) + // } + // }); + // const config = { + // childList: true, + // subtree: true + // }; + // observer.observe(bodyDOM, config); + // getPv() + // }, true); - function getPv() { - xhr = new XMLHttpRequest(); - xhr.open('GET', 'https://api.charles7c.top/blog/pv?pageUrl=' + location.href); - xhr.send(); - }`] + // function getPv() { + // xhr = new XMLHttpRequest(); + // xhr.open('GET', 'https://api.charles7c.top/blog/pv?pageUrl=' + location.href); + // xhr.send(); + // }`] ]; \ No newline at end of file