chore: debug
This commit is contained in:
parent
efd6f7445f
commit
86ab1d894d
5 changed files with 61 additions and 3 deletions
15
src/assets/scripts/index.js
Normal file
15
src/assets/scripts/index.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
const id = Math.floor(Math.random() * Date.now())
|
||||
let i;
|
||||
if (window.sessionStorage && !window.sessionStorage?.getItem('id')) sessionStorage.setItem('id', id)
|
||||
if (window.localStorage && window.localStorage.getItem('i')) i = localStorage.getItem('i')
|
||||
if (!window.fathom) {
|
||||
fetch(`https://coryd.dev/api/event/?page=${encodeURIComponent(window.location.href)}&num=${sessionStorage.getItem('id' || id)}&lang=${navigator.language}&nav=${navigator.userAgent}&i=${i}`)
|
||||
.then((data) => {
|
||||
console.log(data)
|
||||
return {}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
return {}
|
||||
});
|
||||
}
|
Reference in a new issue