message-verify 1.0.1-beta.30 → 1.0.1-beta.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,13 +3,13 @@ import ReactDOM from 'react-dom/client';
3
3
  import VerifyModal from './verify-modal.js';
4
4
  import Fingerprint2 from 'fingerprintjs2';
5
5
  import ReLoginModal from './relogin-modal.js';
6
- // let cachedFingerprint: string | null = null;
6
+ let cachedFingerprint = null;
7
7
  export const initFingerprint = async () => {
8
8
  // console.log('cachedFingerprint', cachedFingerprint);
9
- // if (cachedFingerprint) {
10
- // // 已有缓存,直接返回 Promise
11
- // return Promise.resolve(cachedFingerprint);
12
- // }
9
+ if (cachedFingerprint) {
10
+ // 已有缓存,直接返回 Promise
11
+ return Promise.resolve(cachedFingerprint);
12
+ }
13
13
  // 首次异步获取并缓存
14
14
  return new Promise((resolve) => {
15
15
  Fingerprint2.get(function (components) {
@@ -19,8 +19,10 @@ export const initFingerprint = async () => {
19
19
  .filter(component => includeKeys.includes(component.key))
20
20
  .map(component => component.value)
21
21
  .join('###');
22
+ console.log('values', values);
22
23
  const fingerprint = Fingerprint2.x64hash128(values, 31);
23
- // cachedFingerprint = fingerprint;
24
+ console.log('fingerprint', fingerprint);
25
+ cachedFingerprint = fingerprint;
24
26
  resolve(fingerprint);
25
27
  });
26
28
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "message-verify",
3
- "version": "1.0.1-beta.30",
3
+ "version": "1.0.1-beta.32",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "dependencies": {
package/src/index.tsx CHANGED
@@ -4,13 +4,13 @@ import Fingerprint2 from 'fingerprintjs2';
4
4
  import ReLoginModal from './relogin-modal.js';
5
5
  import { ModalConfig, LoginModalConfig } from './utils/type.js';
6
6
 
7
- // let cachedFingerprint: string | null = null;
7
+ let cachedFingerprint: string | null = null;
8
8
  export const initFingerprint = async (): Promise<string> => {
9
9
  // console.log('cachedFingerprint', cachedFingerprint);
10
- // if (cachedFingerprint) {
11
- // // 已有缓存,直接返回 Promise
12
- // return Promise.resolve(cachedFingerprint);
13
- // }
10
+ if (cachedFingerprint) {
11
+ // 已有缓存,直接返回 Promise
12
+ return Promise.resolve(cachedFingerprint);
13
+ }
14
14
  // 首次异步获取并缓存
15
15
  return new Promise((resolve) => {
16
16
  Fingerprint2.get(function (components) {
@@ -20,8 +20,10 @@ export const initFingerprint = async (): Promise<string> => {
20
20
  .filter(component => includeKeys.includes(component.key))
21
21
  .map(component => component.value)
22
22
  .join('###');
23
+ console.log('values', values);
23
24
  const fingerprint = Fingerprint2.x64hash128(values, 31);
24
- // cachedFingerprint = fingerprint;
25
+ console.log('fingerprint', fingerprint);
26
+ cachedFingerprint = fingerprint;
25
27
  resolve(fingerprint);
26
28
  });
27
29
  });