@bbki.ng/site 5.5.3 → 5.5.4
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbki.ng/site",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.4",
|
|
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.
|
|
17
|
+
"@bbki.ng/ui": "0.2.4"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@eslint/compat": "^1.0.0",
|
|
@@ -263,7 +263,7 @@ async function getAudioFingerprint(): Promise<string | undefined> {
|
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
// 主采集函数
|
|
266
|
-
|
|
266
|
+
async function getFingerprint(): Promise<FingerprintData> {
|
|
267
267
|
const components: Partial<FingerprintComponents> = {
|
|
268
268
|
userAgent: navigator.userAgent,
|
|
269
269
|
language: navigator.language,
|
package/src/blog/utils/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API_ENDPOINT } from '@/constants/routes';
|
|
2
2
|
import { FontType } from '@/types/font';
|
|
3
|
-
import {
|
|
3
|
+
import { getStableDeviceId } from './fingerprints';
|
|
4
4
|
|
|
5
5
|
type Fetcher = (resource: string, init?: any) => Promise<any>;
|
|
6
6
|
|
|
@@ -10,8 +10,8 @@ export const floatNumberToPercentageString = (num: number): string => {
|
|
|
10
10
|
|
|
11
11
|
export const baseFetcher = async (resource: string, init: RequestInit = {}) => {
|
|
12
12
|
const headers = new Headers(init.headers || {});
|
|
13
|
-
const fp = await
|
|
14
|
-
headers.set('X-Device-Fingerprint', fp.
|
|
13
|
+
const fp = await getStableDeviceId();
|
|
14
|
+
headers.set('X-Device-Fingerprint', fp.id);
|
|
15
15
|
return fetch(resource, {
|
|
16
16
|
...init,
|
|
17
17
|
headers,
|