message-verify 1.0.1-beta.55 → 1.0.1-beta.59
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/.arcconfig +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/main.js +1 -1
- package/dist/modal/verify-modal.js +3 -2
- package/dist/utils/type.d.ts +1 -0
- package/package.json +1 -1
- package/src/index.tsx +2 -1
- package/src/main.tsx +1 -1
- package/src/modal/verify-modal.tsx +3 -2
- package/src/utils/type.ts +1 -0
package/.arcconfig
CHANGED
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import { VerifyModalConfig, LoginModalConfig } from './utils/type.js';
|
2
2
|
export declare const initFingerprint: () => Promise<string>;
|
3
3
|
export declare const createReLoginModal: (modalProps: LoginModalConfig) => void;
|
4
|
-
export declare const VerifyHandler: ({ data, config, http, verifyPromise, sendApi }: VerifyModalConfig) => Promise<any>;
|
4
|
+
export declare const VerifyHandler: ({ data, config, http, verifyPromise, sendApi, response }: VerifyModalConfig) => Promise<any>;
|
package/dist/index.js
CHANGED
@@ -54,7 +54,8 @@ export const createReLoginModal = (modalProps) => {
|
|
54
54
|
const reLoginModalId = 'relogin-modal-container';
|
55
55
|
creatModal(modalProps, reLoginModalId, ReLoginModal);
|
56
56
|
};
|
57
|
-
export const VerifyHandler = ({ data, config, http, verifyPromise, sendApi }) => {
|
57
|
+
export const VerifyHandler = ({ data, config, http, verifyPromise, sendApi, response }) => {
|
58
|
+
console.log('VerifyHandler =>', response);
|
58
59
|
const toEmpty = () => {
|
59
60
|
verifyPromise.current = null;
|
60
61
|
};
|
package/dist/main.js
CHANGED
@@ -38,7 +38,7 @@ const config = {
|
|
38
38
|
};
|
39
39
|
const promise = { current: null };
|
40
40
|
createRoot(document.getElementById('root')).render(_jsxs(_Fragment, { children: [_jsx("button", { onClick: () => {
|
41
|
-
return VerifyHandler({ data, config, http: axios, verifyPromise: promise });
|
41
|
+
return VerifyHandler({ data, config, http: axios, verifyPromise: promise, response: {} });
|
42
42
|
}, children: "Show verify Modal" }), _jsx("button", { onClick: () => createReLoginModal({
|
43
43
|
goLogin: () => {
|
44
44
|
console.log('goLogin');
|
@@ -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, sendApi = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty, onClose } = props || {};
|
14
|
+
const { data, http, lang, sendApi = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty, onClose, response } = props || {};
|
15
15
|
const dataObj = JSON.parse(data || '{}');
|
16
16
|
const { mobile, verifyCodeKey } = dataObj || {};
|
17
17
|
const getKey = async () => {
|
@@ -86,6 +86,7 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
86
86
|
'Content-Type': config.headers['Content-Type'],
|
87
87
|
}
|
88
88
|
}).then(res => {
|
89
|
+
console.log('VerifyHandler => then', response);
|
89
90
|
resolve(res);
|
90
91
|
}).catch(err => {
|
91
92
|
reject(err);
|
@@ -93,7 +94,7 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
93
94
|
})
|
94
95
|
]);
|
95
96
|
if (res?.data?.status?.code === 0) {
|
96
|
-
apiResolve(res);
|
97
|
+
// apiResolve(res);
|
97
98
|
setVisible(false);
|
98
99
|
}
|
99
100
|
else {
|
package/dist/utils/type.d.ts
CHANGED
package/package.json
CHANGED
package/src/index.tsx
CHANGED
@@ -64,7 +64,8 @@ export const createReLoginModal = (modalProps: LoginModalConfig) => {
|
|
64
64
|
creatModal(modalProps, reLoginModalId, ReLoginModal);
|
65
65
|
}
|
66
66
|
|
67
|
-
export const VerifyHandler = ({data, config, http, verifyPromise, sendApi}: VerifyModalConfig): Promise<any> => {
|
67
|
+
export const VerifyHandler = ({data, config, http, verifyPromise, sendApi, response}: VerifyModalConfig): Promise<any> => {
|
68
|
+
console.log('VerifyHandler =>', response);
|
68
69
|
const toEmpty = () => {
|
69
70
|
verifyPromise.current = null;
|
70
71
|
};
|
package/src/main.tsx
CHANGED
@@ -43,7 +43,7 @@ const promise = {current: null};
|
|
43
43
|
createRoot(document.getElementById('root')!).render(
|
44
44
|
<>
|
45
45
|
<button onClick={() => {
|
46
|
-
return VerifyHandler({data, config, http: axios, verifyPromise: promise});
|
46
|
+
return VerifyHandler({data, config, http: axios, verifyPromise: promise, response: {}});
|
47
47
|
}}>
|
48
48
|
Show verify Modal
|
49
49
|
</button>
|
@@ -12,7 +12,7 @@ const CreateMessageVerifyModal = ({ props }: { props: VerifyModalConfig }) => {
|
|
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, sendApi = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty, onClose } = props || {};
|
15
|
+
const { data, http, lang, sendApi = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty, onClose, response } = props || {};
|
16
16
|
const dataObj = JSON.parse(data || '{}');
|
17
17
|
const { mobile, verifyCodeKey } = dataObj || {};
|
18
18
|
|
@@ -102,6 +102,7 @@ const CreateMessageVerifyModal = ({ props }: { props: VerifyModalConfig }) => {
|
|
102
102
|
'Content-Type': config.headers['Content-Type'],
|
103
103
|
}
|
104
104
|
}).then(res => {
|
105
|
+
console.log('VerifyHandler => then', response);
|
105
106
|
resolve(res);
|
106
107
|
}).catch(err => {
|
107
108
|
reject(err);
|
@@ -109,7 +110,7 @@ const CreateMessageVerifyModal = ({ props }: { props: VerifyModalConfig }) => {
|
|
109
110
|
})
|
110
111
|
]) as any;
|
111
112
|
if (res?.data?.status?.code === 0) {
|
112
|
-
apiResolve(res);
|
113
|
+
// apiResolve(res);
|
113
114
|
setVisible(false);
|
114
115
|
} else {
|
115
116
|
message.error(t('verifyFail', lang));
|