1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-05 00:21:38 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

用户反馈书籍失效,下载书籍,以及登录注册时记录用户浏览器指纹(获取不到浏览器指纹的使用浏览器UA代替)

This commit is contained in:
2022-04-19 22:49:31 +08:00
parent fe23b88427
commit 26af60e472
16 changed files with 3131 additions and 25 deletions

View File

@@ -18,4 +18,36 @@
<style>
/* 字体加载前先隐藏,不然文字会闪一下 */
html, body { opacity: 0; }
</style>
</style>
<script>
/**
* 获取用户浏览器指纹
*
* refer:
* - https://fingerprintjs.com/
* - https://github.com/fingerprintjs/fingerprintjs
*
*/
// Initialize the agent at application startup.
const fpPromise = import('/assets/lib/fingerprintjs/3.3.3/esm.min.js')
// const fpPromise = import('https://openfpcdn.io/fingerprintjs/v3')
.then(FingerprintJS => FingerprintJS.load())
// // Get the visitor identifier when you need it.
// fpPromise
// .then(fp => fp.get())
// .then(result => {
// // This is the visitor identifier:
// const visitorId = result.visitorId
// console.log(visitorId)
// });
async function getVisitorId() {
try {
return (await fpPromise.then(fp => fp.get())).visitorId;
} catch (error) {
return JSON.stringify(navigator.userAgent);
}
}
</script>