javascript - 指纹js指纹.get不是一个函数
问题描述
目前我在我之前的项目中遇到指纹问题我以这种方式解决了这个问题:
const test = async (req, res, next) => {
// other code
const FingerprintJS = require('@fingerprintjs/fingerprintjs');
const store = require('store')
FingerprintJS.get({
preprocessor: function(key, value) {
return value
}
},function(components){
let values = components.map(function (component) { return component.value });
let device_id = FingerprintJS.x64hash128(values.join(''), 31);
store.set('print', { device: device_id })
});
await new Promise(resolve => setTimeout(resolve, 1000));
// other code
};
但现在我无法将其设置为工作.. 我在 console.log 中遇到错误:
(node:4940) UnhandledPromiseRejectionWarning: TypeError: FingerprintJS.get is not a function
at login (C:\Users\PC06\Desktop\project\backend\controllers\clients-controllers.js:53:17)
(node:4940) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:4940) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a
non-zero exit code.
对此有什么帮助吗?
解决方案
推荐阅读
- angular - VSCode 无法识别 Angular Material 组件(突出显示为红色)
- regex - 使用正则表达式计算 Spark (Scala) 中的 twitter 提及次数
- node.js - node-apn :应根据通知请求或一次性创建提供程序
- python - Fuzzywuzzy 规范化熊猫列中的字符串
- java - Struts2 验证框架在 Hibernate 中抛出异常
- java - Printf 格式问题。不会对齐
- swift - 将 CGFloat 数组标准化为 UIView 帧高度
- linux - linux头文件如何编辑gcc代码
- jquery - jQuery - 查看输入时是否选中“复选框”
- android - FCM - 以不同用户身份登录后无法接收从同一设备发送的通知