message-verify 1.0.1-beta.40 → 1.0.1-beta.41
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 -3
- package/dist/index.js +1 -2
- package/dist/main.js +1 -2
- package/dist/utils/type.d.ts +1 -1
- package/dist/verify-modal.d.ts +2 -2
- package/package.json +1 -1
- package/src/index.tsx +3 -4
- package/src/main.tsx +2 -2
- package/src/utils/type.ts +1 -1
- package/src/verify-modal.tsx +2 -2
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { VerifyModalConfig, LoginModalConfig } from './utils/type.js';
|
2
2
|
export declare const initFingerprint: () => Promise<string>;
|
3
|
-
export declare const createMessageVerifyModal: (modalProps: ModalConfig) => void;
|
4
3
|
export declare const createReLoginModal: (modalProps: LoginModalConfig) => void;
|
5
|
-
export declare const VerifyHandler: (modalProps:
|
4
|
+
export declare const VerifyHandler: (modalProps: VerifyModalConfig) => Promise<any>;
|
package/dist/index.js
CHANGED
@@ -25,9 +25,8 @@ export const initFingerprint = async () => {
|
|
25
25
|
return fingerprintPromise;
|
26
26
|
};
|
27
27
|
let modalRoot = null;
|
28
|
-
|
28
|
+
const createMessageVerifyModal = (modalProps) => {
|
29
29
|
const container = document.createElement('div');
|
30
|
-
container.id = 'antd-modal-container';
|
31
30
|
document.body.appendChild(container);
|
32
31
|
modalRoot = ReactDOM.createRoot(container);
|
33
32
|
modalRoot.render(_jsx(VerifyModal, { props: {
|
package/dist/main.js
CHANGED
@@ -36,9 +36,8 @@ const config = {
|
|
36
36
|
"data": "{\"id\":1,\"classificationName\":\"个人基本概况信息\",\"classificationLevel\":2}",
|
37
37
|
"baseURL": "http://localhost:62888"
|
38
38
|
};
|
39
|
+
const promise = { current: null };
|
39
40
|
createRoot(document.getElementById('root')).render(_jsxs(_Fragment, { children: [_jsx("button", { onClick: () => {
|
40
|
-
// const new11 = new VerifyHandler();
|
41
|
-
const promise = { current: null };
|
42
41
|
return VerifyHandler({ data, config, http: axios, verifyPromise: promise });
|
43
42
|
}, children: "Show verify Modal" }), _jsx("button", { onClick: () => createReLoginModal({
|
44
43
|
goLogin: () => {
|
package/dist/utils/type.d.ts
CHANGED
package/dist/verify-modal.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { VerifyModalConfig } from './utils/type.js';
|
2
2
|
declare const CreateMessageVerifyModal: ({ props }: {
|
3
|
-
props:
|
3
|
+
props: VerifyModalConfig;
|
4
4
|
}) => import("react/jsx-runtime.js").JSX.Element;
|
5
5
|
export default CreateMessageVerifyModal;
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
@@ -2,7 +2,7 @@ import ReactDOM from 'react-dom/client'
|
|
2
2
|
import VerifyModal from './verify-modal.js'
|
3
3
|
import Fingerprint2 from 'fingerprintjs2';
|
4
4
|
import ReLoginModal from './relogin-modal.js';
|
5
|
-
import {
|
5
|
+
import { VerifyModalConfig, LoginModalConfig } from './utils/type.js';
|
6
6
|
|
7
7
|
let fingerprintPromise: Promise<string> | null = null; // 用 Promise 本身作为缓存
|
8
8
|
|
@@ -29,9 +29,8 @@ export const initFingerprint = async (): Promise<string> => {
|
|
29
29
|
|
30
30
|
let modalRoot: ReactDOM.Root | null = null
|
31
31
|
|
32
|
-
|
32
|
+
const createMessageVerifyModal = (modalProps: VerifyModalConfig) => {
|
33
33
|
const container = document.createElement('div')
|
34
|
-
container.id = 'antd-modal-container'
|
35
34
|
document.body.appendChild(container)
|
36
35
|
|
37
36
|
modalRoot = ReactDOM.createRoot(container)
|
@@ -72,7 +71,7 @@ const destroyModal = () => {
|
|
72
71
|
}
|
73
72
|
}
|
74
73
|
|
75
|
-
export const VerifyHandler = (modalProps:
|
74
|
+
export const VerifyHandler = (modalProps: VerifyModalConfig): Promise<any> => {
|
76
75
|
const {data, config, http, verifyPromise} = modalProps || {};
|
77
76
|
const toEmpty = () => {
|
78
77
|
verifyPromise.current = null;
|
package/src/main.tsx
CHANGED
@@ -38,11 +38,11 @@ const config = {
|
|
38
38
|
"data": "{\"id\":1,\"classificationName\":\"个人基本概况信息\",\"classificationLevel\":2}",
|
39
39
|
"baseURL": "http://localhost:62888"
|
40
40
|
};
|
41
|
+
|
42
|
+
const promise = {current: null};
|
41
43
|
createRoot(document.getElementById('root')!).render(
|
42
44
|
<>
|
43
45
|
<button onClick={() => {
|
44
|
-
// const new11 = new VerifyHandler();
|
45
|
-
const promise = {current: null};
|
46
46
|
return VerifyHandler({data, config, http: axios, verifyPromise: promise});
|
47
47
|
}}>
|
48
48
|
Show verify Modal
|
package/src/utils/type.ts
CHANGED
package/src/verify-modal.tsx
CHANGED
@@ -2,10 +2,10 @@ 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 {
|
5
|
+
import { VerifyModalConfig } from './utils/type.js';
|
6
6
|
import { axios } from '@yqg/resource';
|
7
7
|
|
8
|
-
const CreateMessageVerifyModal = ({ props }: { props:
|
8
|
+
const CreateMessageVerifyModal = ({ props }: { props: VerifyModalConfig }) => {
|
9
9
|
const [visible, setVisible] = useState(true);
|
10
10
|
const [countdown, setCountdown] = useState(60);
|
11
11
|
const [otp, setOtp] = useState('');
|