message-verify 1.0.0-beta.14 → 1.0.0-beta.16
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/main.js +1 -1
- package/dist/utils/type.d.ts +1 -0
- package/dist/verify-modal.js +8 -5
- package/eslint.config.js +1 -0
- package/package.json +1 -1
- package/src/main.tsx +1 -1
- package/src/utils/type.ts +1 -0
- package/src/verify-modal.tsx +12 -5
package/dist/main.js
CHANGED
@@ -7,7 +7,7 @@ const fp = await initFingerprint();
|
|
7
7
|
console.log(fp);
|
8
8
|
createRoot(document.getElementById('root')).render(_jsx(_Fragment, { children: _jsx("button", { onClick: () => createMessageVerifyModal({
|
9
9
|
data,
|
10
|
-
config: { headers: {} },
|
10
|
+
config: { headers: {}, interceptors: {} },
|
11
11
|
lang: 'en',
|
12
12
|
http: axios,
|
13
13
|
}), children: "Show verify Modal" }) }));
|
package/dist/utils/type.d.ts
CHANGED
package/dist/verify-modal.js
CHANGED
@@ -63,11 +63,10 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
63
63
|
return (_jsxs(Modal, { width: 420, visible: visible, onClose: () => {
|
64
64
|
setVisible(false);
|
65
65
|
props.onClose?.();
|
66
|
-
}, 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:
|
66
|
+
}, 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: (val) => {
|
67
67
|
setOtp(val);
|
68
|
-
console.log('打印Content-Type', config.headers['Content-Type']);
|
69
68
|
if (val.length === 6) {
|
70
|
-
|
69
|
+
http({
|
71
70
|
...config,
|
72
71
|
headers: {
|
73
72
|
...http.defaults.headers.common,
|
@@ -76,8 +75,12 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
76
75
|
'Content-Type': config.headers['Content-Type'],
|
77
76
|
}
|
78
77
|
});
|
79
|
-
|
80
|
-
|
78
|
+
http.interceptors.response.use((response) => {
|
79
|
+
const { data: { status: { code, detail } }, config: { responseType } } = response;
|
80
|
+
console.log('打印', detail, code, responseType);
|
81
|
+
}, (error) => {
|
82
|
+
console.log('打印', error);
|
83
|
+
});
|
81
84
|
}
|
82
85
|
} }), _jsx(Button, { disabled: countdown > 0 || !captchCode, onClick: handleResend, style: { padding: '8px' }, children: countdown > 0 ? t('countDownSecound', lang, { countdown }) : t('reSend', lang) })] }), countdown > 0 ? null :
|
83
86
|
_jsxs("div", { style: { marginTop: 12, display: 'flex', alignItems: 'center' }, children: [_jsx(Input, { placeholder: t('pleaseEnterPicVerifyCode', lang), onChange: (e) => {
|
package/eslint.config.js
CHANGED
package/package.json
CHANGED
package/src/main.tsx
CHANGED
package/src/utils/type.ts
CHANGED
package/src/verify-modal.tsx
CHANGED
@@ -78,11 +78,10 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
78
78
|
<Input.OTP
|
79
79
|
length={6}
|
80
80
|
value={otp}
|
81
|
-
onChange={
|
81
|
+
onChange={(val) => {
|
82
82
|
setOtp(val);
|
83
|
-
console.log('打印Content-Type', config.headers['Content-Type'])
|
84
83
|
if (val.length === 6) {
|
85
|
-
|
84
|
+
http({
|
86
85
|
...config,
|
87
86
|
headers: {
|
88
87
|
...http.defaults.headers.common,
|
@@ -91,8 +90,16 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
91
90
|
'Content-Type': config.headers['Content-Type'],
|
92
91
|
}
|
93
92
|
});
|
94
|
-
|
95
|
-
|
93
|
+
(http as any).interceptors.response.use(
|
94
|
+
(response: { data: {status: {code: number, detail: string}}, config: {responseType: string} }) => {
|
95
|
+
const {data: {status: {code, detail}}, config: {responseType}} = response;
|
96
|
+
|
97
|
+
console.log('打印', detail, code, responseType);
|
98
|
+
},
|
99
|
+
(error: unknown) => {
|
100
|
+
console.log('打印', error);
|
101
|
+
},
|
102
|
+
);
|
96
103
|
}
|
97
104
|
}} />
|
98
105
|
<Button
|