message-verify 0.0.46-beta.0 → 0.0.47-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/resource.js +1 -1
- package/dist/verify-modal.js +1 -4
- package/package.json +2 -1
- package/src/resource.ts +1 -1
- package/src/verify-modal.tsx +18 -5
- package/vite.config.ts +1 -1
package/dist/resource.js
CHANGED
@@ -2,7 +2,7 @@ import { assign, customPost } from '@yqg/resource';
|
|
2
2
|
// import { assign, axios as instance, customPost } from '@yqg/resource';
|
3
3
|
// import { message } from './compoments/index.js';
|
4
4
|
// import { YQG_SUCCESS } from './utils/status.js';
|
5
|
-
const urlPrefix = '/admin/';
|
5
|
+
const urlPrefix = '/messageVerify/admin/';
|
6
6
|
// axios.defaults.headers.common['Access-Control-Allow-Origin'] = '*';
|
7
7
|
// instance.interceptors.response.use(
|
8
8
|
// (res) => {
|
package/dist/verify-modal.js
CHANGED
@@ -37,9 +37,6 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
37
37
|
clearInterval(timer);
|
38
38
|
};
|
39
39
|
}, [visible, countdown]);
|
40
|
-
// useEffect(() => {
|
41
|
-
// console.log('mobile', mobile);
|
42
|
-
// }, [mobile])
|
43
40
|
const handleResend = async () => {
|
44
41
|
setCountdown(60);
|
45
42
|
const res = await Api.reSendCode({ captchaKey, captcha: captchCode });
|
@@ -57,7 +54,7 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
57
54
|
http(config);
|
58
55
|
setVisible(false);
|
59
56
|
}
|
60
|
-
} }), _jsx(Button, { disabled: countdown > 0 || !captchCode, onClick: handleResend, style: { padding: '
|
57
|
+
} }), _jsx(Button, { disabled: countdown > 0 || !captchCode, onClick: handleResend, style: { padding: '8px' }, children: countdown > 0 ? t('countDownSecound', lang, { countdown }) : t('reSend', lang) })] }), countdown > 0 ? null :
|
61
58
|
_jsxs("div", { style: { marginTop: 12, display: 'flex', alignItems: 'center' }, children: [_jsx(Input, { placeholder: t('pleaseEnterPicVerifyCode', lang), onChange: (e) => {
|
62
59
|
setCaptchCode(e);
|
63
60
|
}, style: { width: 300 } }), captchaImage && _jsx("img", { src: captchaImage, alt: t('verifyCode', lang), style: { width: 100, height: 30, marginLeft: 8 }, onClick: getKey })] }), (countdown > 0 || captchCode) ? null : _jsx("div", { style: { fontSize: 14, color: 'red' }, children: t('pleaseEnterAndSend', lang) })] }));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "message-verify",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.47-beta.0",
|
4
4
|
"type": "module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"dependencies": {
|
@@ -10,6 +10,7 @@
|
|
10
10
|
},
|
11
11
|
"devDependencies": {
|
12
12
|
"@eslint/js": "^9.22.0",
|
13
|
+
"@types/fingerprintjs2": "^2.0.0",
|
13
14
|
"@types/react": "^19.0.10",
|
14
15
|
"@types/react-dom": "^19.0.4",
|
15
16
|
"@vitejs/plugin-react": "^4.3.4",
|
package/src/resource.ts
CHANGED
@@ -3,7 +3,7 @@ import { assign, customPost } from '@yqg/resource';
|
|
3
3
|
// import { message } from './compoments/index.js';
|
4
4
|
// import { YQG_SUCCESS } from './utils/status.js';
|
5
5
|
|
6
|
-
const urlPrefix = '/admin/';
|
6
|
+
const urlPrefix = '/messageVerify/admin/';
|
7
7
|
// axios.defaults.headers.common['Access-Control-Allow-Origin'] = '*';
|
8
8
|
// instance.interceptors.response.use(
|
9
9
|
// (res) => {
|
package/src/verify-modal.tsx
CHANGED
@@ -2,7 +2,23 @@ import { useEffect, useState } from 'react'
|
|
2
2
|
import { Modal, Input, Button, message } from './compoments/index.js'
|
3
3
|
import Api from './resource.js'
|
4
4
|
import t from './utils/i18n.js'
|
5
|
+
// import Fingerprint2 from 'fingerprintjs2';
|
5
6
|
|
7
|
+
// Fingerprint2.get(
|
8
|
+
// { }, // 用 as any 绕过类型检查
|
9
|
+
// function(components) {
|
10
|
+
// console.log('components', components);
|
11
|
+
// const excludeKeys = ['screenResolution', 'colorDepth', 'availableScreenResolution'];
|
12
|
+
// const values = components
|
13
|
+
// .filter(component => !excludeKeys.includes(component.key)) // 排除多个 key
|
14
|
+
// .map(component => component.value)
|
15
|
+
// .join('###');
|
16
|
+
// // const values = components.map(function (component) { return component.value }).join('###');
|
17
|
+
// // 生成 hash 指纹码
|
18
|
+
// const fingerprint = Fingerprint2.x64hash128(values, 31);
|
19
|
+
// console.log('fingerprint', fingerprint);
|
20
|
+
// }
|
21
|
+
// );
|
6
22
|
type ModalConfig = {
|
7
23
|
data: string;
|
8
24
|
onClose?: () => void;
|
@@ -20,6 +36,7 @@ type ModalConfig = {
|
|
20
36
|
};
|
21
37
|
}
|
22
38
|
const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
39
|
+
|
23
40
|
const [visible, setVisible] = useState(true);
|
24
41
|
const [countdown, setCountdown] = useState(3);
|
25
42
|
const [otp, setOtp] = useState('');
|
@@ -55,10 +72,6 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
55
72
|
};
|
56
73
|
}, [visible, countdown]);
|
57
74
|
|
58
|
-
// useEffect(() => {
|
59
|
-
// console.log('mobile', mobile);
|
60
|
-
// }, [mobile])
|
61
|
-
|
62
75
|
const handleResend = async() => {
|
63
76
|
setCountdown(60);
|
64
77
|
const res = await Api.reSendCode({captchaKey, captcha: captchCode});
|
@@ -93,7 +106,7 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
93
106
|
<Button
|
94
107
|
disabled={countdown > 0 || !captchCode}
|
95
108
|
onClick={handleResend}
|
96
|
-
style={{ padding: '
|
109
|
+
style={{ padding: '8px' }}
|
97
110
|
>
|
98
111
|
{countdown > 0 ? t('countDownSecound', lang, { countdown }) : t('reSend', lang)}
|
99
112
|
</Button>
|