message-verify 0.0.49-beta.0 → 0.0.51-beta.0
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.d.ts +2 -1
- package/dist/index.js +5 -0
- package/dist/resource.js +1 -1
- package/package.json +1 -1
- package/src/index.tsx +8 -1
- package/src/resource.ts +1 -1
- package/vite.config.ts +4 -4
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -2,7 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import ReactDOM from 'react-dom/client';
|
3
3
|
import VerifyModal from './verify-modal.js';
|
4
4
|
import Fingerprint2 from 'fingerprintjs2';
|
5
|
+
let cachedFingerprint = null;
|
5
6
|
export const getFingerprint = () => {
|
7
|
+
return cachedFingerprint;
|
8
|
+
};
|
9
|
+
export const initFingerprint = () => {
|
6
10
|
return new Promise((resolve) => {
|
7
11
|
Fingerprint2.get(function (components) {
|
8
12
|
const includeKeys = ['userAgent', 'deviceMemory', 'cpuClass', 'hardwareConcurrency', 'platform'];
|
@@ -11,6 +15,7 @@ export const getFingerprint = () => {
|
|
11
15
|
.map(component => component.value)
|
12
16
|
.join('###');
|
13
17
|
const fingerprint = Fingerprint2.x64hash128(values, 31);
|
18
|
+
cachedFingerprint = fingerprint;
|
14
19
|
resolve(fingerprint);
|
15
20
|
});
|
16
21
|
});
|
package/dist/resource.js
CHANGED
@@ -45,6 +45,6 @@ const api = {
|
|
45
45
|
urlPrefix,
|
46
46
|
getCaptchaKey: customPost('captcha/key'),
|
47
47
|
reSendCode: customPost('sms/send'),
|
48
|
-
getCaptchaImgUrl: (captchaKey) => { return
|
48
|
+
getCaptchaImgUrl: (captchaKey) => { return `/messageVerify/admin/captcha/image/${captchaKey}`; },
|
49
49
|
};
|
50
50
|
export default assign(api);
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
@@ -2,7 +2,13 @@ import ReactDOM from 'react-dom/client'
|
|
2
2
|
import VerifyModal from './verify-modal.js'
|
3
3
|
import Fingerprint2 from 'fingerprintjs2';
|
4
4
|
|
5
|
-
|
5
|
+
let cachedFingerprint: string | null = null;
|
6
|
+
|
7
|
+
export const getFingerprint = (): string | null => {
|
8
|
+
return cachedFingerprint;
|
9
|
+
};
|
10
|
+
|
11
|
+
export const initFingerprint = (): Promise<string> => {
|
6
12
|
return new Promise((resolve) => {
|
7
13
|
Fingerprint2.get(function (components) {
|
8
14
|
const includeKeys = ['userAgent', 'deviceMemory', 'cpuClass', 'hardwareConcurrency', 'platform'];
|
@@ -11,6 +17,7 @@ export const getFingerprint = (): Promise<string> => {
|
|
11
17
|
.map(component => component.value)
|
12
18
|
.join('###');
|
13
19
|
const fingerprint = Fingerprint2.x64hash128(values, 31);
|
20
|
+
cachedFingerprint = fingerprint;
|
14
21
|
resolve(fingerprint);
|
15
22
|
});
|
16
23
|
});
|
package/src/resource.ts
CHANGED
@@ -51,7 +51,7 @@ const api = {
|
|
51
51
|
|
52
52
|
getCaptchaKey: customPost('captcha/key'),
|
53
53
|
reSendCode: customPost('sms/send'),
|
54
|
-
getCaptchaImgUrl: (captchaKey: string) => {return
|
54
|
+
getCaptchaImgUrl: (captchaKey: string) => {return `/messageVerify/admin/captcha/image/${captchaKey}`},
|
55
55
|
};
|
56
56
|
|
57
57
|
export default assign(api);
|
package/vite.config.ts
CHANGED
@@ -8,12 +8,12 @@ export default defineConfig({
|
|
8
8
|
server: {
|
9
9
|
port: 5174, // 你的端口
|
10
10
|
proxy: {
|
11
|
-
'/
|
12
|
-
target: 'https://
|
11
|
+
'/messageVerify': {
|
12
|
+
target: 'https://reconcile-test.yangqianguan.com',
|
13
13
|
changeOrigin: true,
|
14
14
|
headers: {
|
15
|
-
host: '
|
16
|
-
origin: '
|
15
|
+
host: 'reconcile-test.yangqianguan.com', // 和转发url一样 host不带协议头 origin带上
|
16
|
+
origin: 'https://reconcile-test.yangqianguan.com'
|
17
17
|
},
|
18
18
|
|
19
19
|
},
|