@bbki.ng/site 5.5.1 → 5.5.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 5.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 71ce23d: hash error
8
+ - Updated dependencies [71ce23d]
9
+ - @bbki.ng/ui@0.2.3
10
+
11
+ ## 5.5.2
12
+
13
+ ### Patch Changes
14
+
15
+ - 039575f: fix hash str
16
+ - Updated dependencies [039575f]
17
+ - @bbki.ng/ui@0.2.2
18
+
3
19
  ## 5.5.1
4
20
 
5
21
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "5.5.1",
3
+ "version": "5.5.3",
4
4
  "description": "code behind bbki.ng",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -14,7 +14,7 @@
14
14
  "react-dom": "^18.0.0",
15
15
  "react-router-dom": "6",
16
16
  "swr": "^2.2.5",
17
- "@bbki.ng/ui": "0.2.1"
17
+ "@bbki.ng/ui": "0.2.3"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@eslint/compat": "^1.0.0",
@@ -2,13 +2,13 @@ import { useRef } from 'react';
2
2
  import { useFingerprint } from '@/hooks/use_fingerprint';
3
3
 
4
4
  export const useFingerprintUniforms = () => {
5
- const { fingerprint, loading } = useFingerprint();
5
+ const { deviceId, loading } = useFingerprint();
6
6
 
7
7
  const charsRef = useRef<number[] | null>(null);
8
8
  const appliedRef = useRef(false);
9
9
 
10
- if (!loading && fingerprint && !charsRef.current) {
11
- const hash = fingerprint.hash.slice(0, 16);
10
+ if (!loading && deviceId && !charsRef.current) {
11
+ const hash = deviceId;
12
12
  const chars = [...hash].map(c => parseInt(c, 16) || 0);
13
13
  while (chars.length < 16) chars.push(0);
14
14
  charsRef.current = chars;
@@ -42,13 +42,6 @@ export const useFingerprintUniforms = () => {
42
42
  inst.uniforms.uFpChars4.value[2] = chars[14];
43
43
  inst.uniforms.uFpChars4.value[3] = chars[15];
44
44
 
45
- // console.log('[Fingerprint] Uniforms set:', {
46
- // uFpChars1: inst.uniforms.uFpChars1.value,
47
- // uFpChars2: inst.uniforms.uFpChars2.value,
48
- // uFpChars3: inst.uniforms.uFpChars3.value,
49
- // uFpChars4: inst.uniforms.uFpChars4.value,
50
- // });
51
-
52
45
  appliedRef.current = true;
53
46
  };
54
47
 
@@ -330,7 +330,7 @@ export async function getStableDeviceId(): Promise<{ id: string; fp: Fingerprint
330
330
 
331
331
  // 生成新ID
332
332
  const fp = await getFingerprint();
333
- const id = `dev_${fp.hash.slice(0, 16)}_${Date.now().toString(36)}`;
333
+ const id = fp.hash.slice(0, 16);
334
334
 
335
335
  localStorage.setItem(
336
336
  STORAGE_KEY,