message-verify 1.0.0-beta.5 → 1.0.0-beta.6
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/utils/type.d.ts +1 -0
- package/dist/verify-modal.js +3 -2
- package/package.json +1 -1
- package/src/utils/type.ts +1 -0
- package/src/verify-modal.tsx +3 -2
package/dist/utils/type.d.ts
CHANGED
package/dist/verify-modal.js
CHANGED
@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react';
|
|
3
3
|
import { Modal, Input, Button, message } from './compoments/index.js';
|
4
4
|
import Api from './resource.js';
|
5
5
|
import t from './utils/i18n.js';
|
6
|
+
import { axios } from '@yqg/resource';
|
6
7
|
const CreateMessageVerifyModal = ({ props }) => {
|
7
8
|
const [visible, setVisible] = useState(true);
|
8
9
|
const [countdown, setCountdown] = useState(60);
|
@@ -10,7 +11,7 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
10
11
|
const [captchaImage, setCaptchaImage] = useState('');
|
11
12
|
const [captchCode, setCaptchCode] = useState('');
|
12
13
|
const [captchaKey, setCaptchaKey] = useState('');
|
13
|
-
const { data, config, http, lang } = props || {};
|
14
|
+
const { data, config, http, lang, api = '/admin/sms/send' } = props || {};
|
14
15
|
const dataObj = JSON.parse(data || '{}');
|
15
16
|
const { mobile, verifyCodeKey } = dataObj || {};
|
16
17
|
const getKey = async () => {
|
@@ -51,7 +52,7 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
51
52
|
formData.append('captchaKey', captchaKey);
|
52
53
|
formData.append('captcha', captchCode);
|
53
54
|
// 重新发送验证码
|
54
|
-
await
|
55
|
+
await axios.post(api, formData);
|
55
56
|
message.success(t('sendSuccess', lang));
|
56
57
|
};
|
57
58
|
return (_jsxs(Modal, { width: 420, visible: visible, onClose: () => {
|
package/package.json
CHANGED
package/src/utils/type.ts
CHANGED
package/src/verify-modal.tsx
CHANGED
@@ -3,6 +3,7 @@ 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
5
|
import { ModalConfig } from './utils/type.js';
|
6
|
+
import { axios } from '@yqg/resource';
|
6
7
|
|
7
8
|
const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
8
9
|
const [visible, setVisible] = useState(true);
|
@@ -11,7 +12,7 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
11
12
|
const [captchaImage, setCaptchaImage] = useState<string>('');
|
12
13
|
const [captchCode, setCaptchCode] = useState<string>('');
|
13
14
|
const [captchaKey, setCaptchaKey] = useState<string>('');
|
14
|
-
const { data, config, http, lang } = props || {};
|
15
|
+
const { data, config, http, lang, api='/admin/sms/send' } = props || {};
|
15
16
|
const dataObj = JSON.parse(data || '{}');
|
16
17
|
const { mobile, verifyCodeKey } = dataObj || {};
|
17
18
|
|
@@ -53,7 +54,7 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
53
54
|
formData.append('captchaKey', captchaKey);
|
54
55
|
formData.append('captcha', captchCode);
|
55
56
|
// 重新发送验证码
|
56
|
-
await
|
57
|
+
await axios.post(api, formData);
|
57
58
|
message.success(t('sendSuccess', lang));
|
58
59
|
}
|
59
60
|
|