优化:调用记录页面浏览量 API 时,增加时间戳来预防缓存

This commit is contained in:
2022-11-28 10:15:08 +08:00
parent c5a1dd5183
commit 699e469c60

View File

@@ -30,7 +30,7 @@ export const head: HeadConfig[] = [
['script', {}, `var pageUrl = location.href; ['script', {}, `var pageUrl = location.href;
(function() { (function() {
xhr = new XMLHttpRequest(); xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.charles7c.top/blog/pv?pageUrl=' + pageUrl); xhr.open('GET', 'https://api.charles7c.top/blog/pv?pageUrl=' + pageUrl + "&t=" + new Date().getTime());
xhr.send(); xhr.send();
})();`] })();`]
/*['script', {}, `var pageUrl = location.href; /*['script', {}, `var pageUrl = location.href;