纵有疾风起
人生不言弃

javascript获取手机唯一识别码

先引入一个文件fp.min.js

点击文件下载:fp.min.js

使用代码:

<script>
    const fpPromise = new Promise((resolve, reject) => {
    const script = document.createElement('script')
    script.onload = resolve
    script.onerror = reject
    script.async = true
    script.src = '/res/fp.min.js'
    document.head.appendChild(script)
  })
    .then(() => 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)
    })
</script>
未经允许不得转载:起风网 » javascript获取手机唯一识别码
分享到: 生成海报

评论 抢沙发

评论前必须登录!

立即登录