message-verify 1.0.0-beta.12 → 1.0.0-beta.14

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 ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "phabricator.uri": "https://code.yangqianguan.com/",
3
+ "lint.engine": "YqgWebDiffLintEngine"
4
+ }
@@ -6,7 +6,7 @@ import t from './utils/i18n.js';
6
6
  import { axios } from '@yqg/resource';
7
7
  const CreateMessageVerifyModal = ({ props }) => {
8
8
  const [visible, setVisible] = useState(true);
9
- const [countdown, setCountdown] = useState(2);
9
+ const [countdown, setCountdown] = useState(60);
10
10
  const [otp, setOtp] = useState('');
11
11
  const [captchaImage, setCaptchaImage] = useState('');
12
12
  const [captchCode, setCaptchCode] = useState('');
@@ -52,9 +52,7 @@ const CreateMessageVerifyModal = ({ props }) => {
52
52
  formData.append('captcha', captchCode);
53
53
  // 重新发送验证码
54
54
  const res = await axios.post(api, formData);
55
- console.log('打印res', res);
56
55
  const { code, detail } = res.data?.status || {};
57
- console.log('打印code', code);
58
56
  if (code !== 0) {
59
57
  message.error(detail || t('sendFailed', lang));
60
58
  return;
@@ -65,11 +63,11 @@ const CreateMessageVerifyModal = ({ props }) => {
65
63
  return (_jsxs(Modal, { width: 420, visible: visible, onClose: () => {
66
64
  setVisible(false);
67
65
  props.onClose?.();
68
- }, 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) => {
69
67
  setOtp(val);
70
68
  console.log('打印Content-Type', config.headers['Content-Type']);
71
69
  if (val.length === 6) {
72
- http({
70
+ const res = await http({
73
71
  ...config,
74
72
  headers: {
75
73
  ...http.defaults.headers.common,
@@ -78,7 +76,8 @@ const CreateMessageVerifyModal = ({ props }) => {
78
76
  'Content-Type': config.headers['Content-Type'],
79
77
  }
80
78
  });
81
- setVisible(false);
79
+ console.log('接口返回值', res);
80
+ // setVisible(false);
82
81
  }
83
82
  } }), _jsx(Button, { disabled: countdown > 0 || !captchCode, onClick: handleResend, style: { padding: '8px' }, children: countdown > 0 ? t('countDownSecound', lang, { countdown }) : t('reSend', lang) })] }), countdown > 0 ? null :
84
83
  _jsxs("div", { style: { marginTop: 12, display: 'flex', alignItems: 'center' }, children: [_jsx(Input, { placeholder: t('pleaseEnterPicVerifyCode', lang), onChange: (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "message-verify",
3
- "version": "1.0.0-beta.12",
3
+ "version": "1.0.0-beta.14",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "dependencies": {
@@ -7,7 +7,7 @@ import { axios } from '@yqg/resource';
7
7
 
8
8
  const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
9
9
  const [visible, setVisible] = useState(true);
10
- const [countdown, setCountdown] = useState(2);
10
+ const [countdown, setCountdown] = useState(60);
11
11
  const [otp, setOtp] = useState('');
12
12
  const [captchaImage, setCaptchaImage] = useState<string>('');
13
13
  const [captchCode, setCaptchCode] = useState<string>('');
@@ -54,9 +54,7 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
54
54
  formData.append('captcha', captchCode);
55
55
  // 重新发送验证码
56
56
  const res = await axios.post(api, formData);
57
- console.log('打印res', res)
58
57
  const { code, detail } = res.data?.status || {};
59
- console.log('打印code', code)
60
58
  if (code !== 0) {
61
59
  message.error(detail || t('sendFailed', lang));
62
60
  return;
@@ -80,11 +78,11 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
80
78
  <Input.OTP
81
79
  length={6}
82
80
  value={otp}
83
- onChange={(val) => {
81
+ onChange={async (val) => {
84
82
  setOtp(val);
85
83
  console.log('打印Content-Type', config.headers['Content-Type'])
86
84
  if (val.length === 6) {
87
- http({
85
+ const res = await http({
88
86
  ...config,
89
87
  headers: {
90
88
  ...http.defaults.headers.common,
@@ -93,7 +91,8 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
93
91
  'Content-Type': config.headers['Content-Type'],
94
92
  }
95
93
  });
96
- setVisible(false);
94
+ console.log('接口返回值', res);
95
+ // setVisible(false);
97
96
  }
98
97
  }} />
99
98
  <Button