message-verify 1.0.1-beta.11 → 1.0.1-beta.12
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/verify-modal.js +5 -3
- package/package.json +1 -1
- package/src/verify-modal.tsx +5 -3
package/dist/verify-modal.js
CHANGED
@@ -63,11 +63,11 @@ 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: (val) => {
|
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: async (val) => {
|
67
67
|
setOtp(val);
|
68
68
|
if (val.length === 6) {
|
69
69
|
try {
|
70
|
-
http({
|
70
|
+
const res = await http({
|
71
71
|
...response?.config,
|
72
72
|
headers: {
|
73
73
|
...http.defaults.headers.common,
|
@@ -76,6 +76,7 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
76
76
|
'Content-Type': response?.config.headers['Content-Type'],
|
77
77
|
}
|
78
78
|
});
|
79
|
+
console.log('res', res);
|
79
80
|
const { code, detail } = response?.data?.status || {};
|
80
81
|
if (code !== 0) {
|
81
82
|
const detailObj = JSON.parse(detail || '{}');
|
@@ -83,8 +84,9 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
83
84
|
return;
|
84
85
|
}
|
85
86
|
else {
|
86
|
-
message.success(t('verifySuccess', lang));
|
87
|
+
// message.success(t('verifySuccess', lang));
|
87
88
|
setVisible(false);
|
89
|
+
return Promise.resolve(response);
|
88
90
|
}
|
89
91
|
}
|
90
92
|
catch (error) {
|
package/package.json
CHANGED
package/src/verify-modal.tsx
CHANGED
@@ -78,11 +78,11 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
78
78
|
<Input.OTP
|
79
79
|
length={6}
|
80
80
|
value={otp}
|
81
|
-
onChange={(val) => {
|
81
|
+
onChange={async (val) => {
|
82
82
|
setOtp(val);
|
83
83
|
if (val.length === 6) {
|
84
84
|
try {
|
85
|
-
http({
|
85
|
+
const res = await http({
|
86
86
|
...response?.config,
|
87
87
|
headers: {
|
88
88
|
...http.defaults.headers.common,
|
@@ -91,14 +91,16 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
91
91
|
'Content-Type': response?.config.headers['Content-Type'],
|
92
92
|
}
|
93
93
|
});
|
94
|
+
console.log('res', res);
|
94
95
|
const { code, detail } = response?.data?.status || {};
|
95
96
|
if (code !== 0) {
|
96
97
|
const detailObj = JSON.parse(detail || '{}');
|
97
98
|
message.error(detailObj?.message || t('sendFailed', lang));
|
98
99
|
return;
|
99
100
|
} else {
|
100
|
-
message.success(t('verifySuccess', lang));
|
101
|
+
// message.success(t('verifySuccess', lang));
|
101
102
|
setVisible(false);
|
103
|
+
return Promise.resolve(response);
|
102
104
|
}
|
103
105
|
} catch (error: any) {
|
104
106
|
message.error(error?.message || t('sendFailed', lang));
|