This commit is contained in:
2026-03-03 16:16:16 +08:00
parent 62546bc937
commit 33913c29d2
9 changed files with 1153 additions and 239 deletions
+20
View File
@@ -8,6 +8,26 @@
</head>
<body>
<div id="app"></div>
<script>
;(() => {
const makeVisitVersion = () => {
if (window.crypto && typeof window.crypto.getRandomValues === 'function') {
const bytes = new Uint32Array(2)
window.crypto.getRandomValues(bytes)
return `${Date.now().toString(36)}-${bytes[0].toString(36)}${bytes[1].toString(36)}`
}
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`
}
const url = new URL(window.location.href)
url.searchParams.set('v', makeVisitVersion())
const nextUrl = `${url.pathname}${url.search}${url.hash}`
const currentUrl = `${window.location.pathname}${window.location.search}${window.location.hash}`
if (nextUrl !== currentUrl) {
window.history.replaceState(null, '', nextUrl)
}
})()
</script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>