app端(un-app)
请求头增加 'Appuuid'
// #ifdef APP-PLUS
'Appuuid': plus.device.uuid,//设备唯一码
// #endif
web端
请求头增加 'Webuuid'
getWebuuid() {
// 浏览器唯一码-开始
const fpPromise = new Promise((resolve, reject) => {
const script = document.createElement('script')
script.onload = resolve
script.onerror = reject
script.async = true
script.src =
'https://cdn.jsdelivr.net/npm/' +
'@fingerprintjs/fingerprintjs@3/dist/fp.min.js'
document.head.appendChild(script)
}).then(() => FingerprintJS.load())
fpPromise
.then((fp) => fp.get())
.then((result) => {
localStorage.setItem('Webuuid', result.visitorId)
})
// 浏览器唯一码-结束
},