message-verify 1.0.1-beta.34 → 1.0.1-beta.36
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 +2 -0
- package/dist/main.js +2 -0
- package/dist/utils/type.d.ts +1 -0
- package/dist/verify-modal.js +2 -2
- package/package.json +1 -1
- package/src/index.tsx +2 -0
- package/src/main.tsx +2 -0
- package/src/utils/type.ts +1 -0
- package/src/verify-modal.tsx +2 -2
package/dist/index.js
CHANGED
@@ -5,10 +5,12 @@ import Fingerprint2 from 'fingerprintjs2';
|
|
5
5
|
import ReLoginModal from './relogin-modal.js';
|
6
6
|
let fingerprintPromise = null; // 用 Promise 本身作为缓存
|
7
7
|
export const initFingerprint = async () => {
|
8
|
+
console.log('fingerprintPromise:', fingerprintPromise);
|
8
9
|
if (!fingerprintPromise) {
|
9
10
|
fingerprintPromise = new Promise((resolve) => {
|
10
11
|
Fingerprint2.get(components => {
|
11
12
|
const includeKeys = ['userAgent', 'deviceMemory', 'cpuClass', 'hardwareConcurrency', 'platform'];
|
13
|
+
console.log('components:', components);
|
12
14
|
const values = components
|
13
15
|
.filter(c => includeKeys.includes(c.key))
|
14
16
|
.map(c => c.value)
|
package/dist/main.js
CHANGED
@@ -44,6 +44,8 @@ createRoot(document.getElementById('root')).render(_jsxs(_Fragment, { children:
|
|
44
44
|
apiReject: () => {
|
45
45
|
},
|
46
46
|
apiResolve: () => {
|
47
|
+
},
|
48
|
+
apiPromiseToEmpty: () => {
|
47
49
|
}
|
48
50
|
}), children: "Show verify Modal" }), _jsx("button", { onClick: () => createReLoginModal({
|
49
51
|
goLogin: () => {
|
package/dist/utils/type.d.ts
CHANGED
package/dist/verify-modal.js
CHANGED
@@ -11,7 +11,7 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
11
11
|
const [captchaImage, setCaptchaImage] = useState('');
|
12
12
|
const [captchCode, setCaptchCode] = useState('');
|
13
13
|
const [captchaKey, setCaptchaKey] = useState('');
|
14
|
-
const { data, http, lang, api = '/admin/sms/send', config, apiResolve,
|
14
|
+
const { data, http, lang, api = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty } = props || {};
|
15
15
|
const dataObj = JSON.parse(data || '{}');
|
16
16
|
const { mobile, verifyCodeKey } = dataObj || {};
|
17
17
|
const getKey = async () => {
|
@@ -64,7 +64,7 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
64
64
|
};
|
65
65
|
return (_jsxs(Modal, { width: 420, visible: visible, onClose: () => {
|
66
66
|
setVisible(false);
|
67
|
-
|
67
|
+
apiPromiseToEmpty();
|
68
68
|
props.onClose?.();
|
69
69
|
}, children: [_jsx("div", { style: { fontSize: 14, color: '#666' }, children: t('alreadySend', lang, { phone: mobile }) }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8, marginTop: 12 }, children: [_jsx(Input.OTP, { length: 6, value: otp, onChange: async (val) => {
|
70
70
|
setOtp(val);
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
@@ -7,10 +7,12 @@ import { ModalConfig, LoginModalConfig } from './utils/type.js';
|
|
7
7
|
let fingerprintPromise: Promise<string> | null = null; // 用 Promise 本身作为缓存
|
8
8
|
|
9
9
|
export const initFingerprint = async (): Promise<string> => {
|
10
|
+
console.log('fingerprintPromise:', fingerprintPromise);
|
10
11
|
if (!fingerprintPromise) {
|
11
12
|
fingerprintPromise = new Promise((resolve) => {
|
12
13
|
Fingerprint2.get(components => {
|
13
14
|
const includeKeys = ['userAgent', 'deviceMemory', 'cpuClass', 'hardwareConcurrency', 'platform'];
|
15
|
+
console.log('components:', components);
|
14
16
|
const values = components
|
15
17
|
.filter(c => includeKeys.includes(c.key))
|
16
18
|
.map(c => c.value)
|
package/src/main.tsx
CHANGED
package/src/utils/type.ts
CHANGED
package/src/verify-modal.tsx
CHANGED
@@ -12,7 +12,7 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
12
12
|
const [captchaImage, setCaptchaImage] = useState<string>('');
|
13
13
|
const [captchCode, setCaptchCode] = useState<string>('');
|
14
14
|
const [captchaKey, setCaptchaKey] = useState<string>('');
|
15
|
-
const { data, http, lang, api = '/admin/sms/send', config, apiResolve,
|
15
|
+
const { data, http, lang, api = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty } = props || {};
|
16
16
|
const dataObj = JSON.parse(data || '{}');
|
17
17
|
const { mobile, verifyCodeKey } = dataObj || {};
|
18
18
|
|
@@ -72,7 +72,7 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
72
72
|
visible={visible}
|
73
73
|
onClose={() => {
|
74
74
|
setVisible(false);
|
75
|
-
|
75
|
+
apiPromiseToEmpty();
|
76
76
|
props.onClose?.();
|
77
77
|
}}
|
78
78
|
>
|