vue使用fingerprintjs生成浏览器唯一标识(浏览器指纹)

vue使用fingerprintjs生成浏览器唯一标识(浏览器指纹)

1. 安装

github: https://github.com/fingerprintjs/fingerprintjs

npm i @fingerprintjs/fingerprintjs -S

2. 引用

import FingerprintJS from '@fingerprintjs/fingerprintjs'

3. 使用

FingerprintJS.load().then(fp => {
    fp.get().then(result => {
        const visitorId = result.visitorId;
        console.log(visitorId);
    });
});

你可能感兴趣的:(Web前端,vue.js,javascript,前端)