message-verify 1.0.0-beta.11 → 1.0.0-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/main.js CHANGED
@@ -1,13 +1,13 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { createRoot } from 'react-dom/client';
3
3
  import { createMessageVerifyModal, initFingerprint } from './index.js'; // 或 './index'
4
4
  import { axios } from '@yqg/resource';
5
5
  const data = "{\"mobile\":\"188****4035\",\"verifyCodeKey\":\"3f025b33-988e-47c0-950d-6beb776d043f\",\"needValid\":true,\"step\":2,\"message\":\"需要填写验证码\"}";
6
6
  const fp = await initFingerprint();
7
7
  console.log(fp);
8
- createRoot(document.getElementById('root')).render(_jsx("button", { onClick: () => createMessageVerifyModal({
9
- data,
10
- config: { headers: {} },
11
- lang: 'en',
12
- http: axios,
13
- }), children: "Show Modal" }));
8
+ createRoot(document.getElementById('root')).render(_jsx(_Fragment, { children: _jsx("button", { onClick: () => createMessageVerifyModal({
9
+ data,
10
+ config: { headers: {} },
11
+ lang: 'en',
12
+ http: axios,
13
+ }), children: "Show verify Modal" }) }));
@@ -0,0 +1,5 @@
1
+ import { ModalConfig } from './utils/type.js';
2
+ declare const ReLoginModal: ({ props }: {
3
+ props: ModalConfig;
4
+ }) => import("react/jsx-runtime.js").JSX.Element;
5
+ export default ReLoginModal;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Modal, Button } from './compoments/index.js';
4
+ const ReLoginModal = ({ props }) => {
5
+ console.log('props', props);
6
+ const [visible, setVisible] = useState(true);
7
+ const onClose = () => {
8
+ setVisible(false);
9
+ };
10
+ return (_jsxs(Modal, { visible: visible, onClose: onClose, width: 420, children: [_jsx("div", { style: { fontWeight: 500, fontSize: 20, marginBottom: 24 }, children: "\u8D26\u53F7\u5B89\u5168\u63D0\u9192" }), _jsx("div", { style: { color: '#222', fontSize: 16, marginBottom: 40, lineHeight: '24px' }, children: "\u68C0\u6D4B\u5230\u60A8\u7684\u767B\u5F55\u73AF\u5883\u6216\u7F51\u7EDC\u4FE1\u606F\u6709\u53D8\u52A8\uFF0C\u4E3A\u4FDD\u969C\u8D26\u6237\u5B89\u5168\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u9A8C\u8BC1\u8EAB\u4EFD" }), _jsx("div", { style: { display: 'flex', justifyContent: 'center' }, children: _jsx(Button, { style: {
11
+ background: '#1677ff',
12
+ color: '#fff',
13
+ border: 'none',
14
+ width: 160,
15
+ height: 44,
16
+ fontSize: 18,
17
+ fontWeight: 500,
18
+ borderRadius: 8,
19
+ boxShadow: '0 2px 8px rgba(22,119,255,0.08)',
20
+ }, onClick: onClose, children: "\u597D\u7684" }) })] }));
21
+ };
22
+ export default ReLoginModal;
@@ -1 +1 @@
1
- {"root":["../src/index.tsx","../src/main.tsx","../src/resource.ts","../src/verify-modal.tsx","../src/vite-env.d.ts","../src/compoments/button.tsx","../src/compoments/index.ts","../src/compoments/input.tsx","../src/compoments/message.tsx","../src/compoments/modal.tsx","../src/locales/en.ts","../src/locales/id.ts","../src/locales/zh.ts","../src/utils/i18n.ts","../src/utils/status.ts","../src/utils/type.ts"],"version":"5.7.3"}
1
+ {"root":["../src/index.tsx","../src/main.tsx","../src/relogin-modal.tsx","../src/resource.ts","../src/verify-modal.tsx","../src/vite-env.d.ts","../src/compoments/button.tsx","../src/compoments/index.ts","../src/compoments/input.tsx","../src/compoments/message.tsx","../src/compoments/modal.tsx","../src/locales/en.ts","../src/locales/id.ts","../src/locales/zh.ts","../src/utils/i18n.ts","../src/utils/status.ts","../src/utils/type.ts"],"version":"5.7.3"}
@@ -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(60);
9
+ const [countdown, setCountdown] = useState(2);
10
10
  const [otp, setOtp] = useState('');
11
11
  const [captchaImage, setCaptchaImage] = useState('');
12
12
  const [captchCode, setCaptchCode] = useState('');
@@ -52,7 +52,9 @@ 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);
55
56
  const { code, detail } = res.data?.status || {};
57
+ console.log('打印code', code);
56
58
  if (code !== 0) {
57
59
  message.error(detail || t('sendFailed', lang));
58
60
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "message-verify",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.12",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "dependencies": {
package/src/main.tsx CHANGED
@@ -8,11 +8,13 @@ const fp = await initFingerprint();
8
8
  console.log(fp);
9
9
 
10
10
  createRoot(document.getElementById('root')!).render(
11
+ <>
11
12
  <button onClick={() => createMessageVerifyModal({
12
13
  data,
13
14
  config: {headers: {}},
14
15
  lang: 'en',
15
16
  http: axios,
16
17
  })}>
17
- Show Modal
18
- </button>);
18
+ Show verify Modal
19
+ </button>
20
+ </>);
@@ -0,0 +1,41 @@
1
+ import { useState } from 'react'
2
+ import { Modal, Button } from './compoments/index.js'
3
+ import { ModalConfig } from './utils/type.js';
4
+
5
+ const ReLoginModal = ({ props }: { props: ModalConfig }) => {
6
+ console.log('props', props);
7
+ const [visible, setVisible] = useState(true);
8
+ const onClose = () => {
9
+ setVisible(false);
10
+ };
11
+ return (
12
+ <Modal visible={visible} onClose={onClose} width={420}>
13
+ <div style={{ fontWeight: 500, fontSize: 20, marginBottom: 24 }}>
14
+ 账号安全提醒
15
+ </div>
16
+ <div style={{ color: '#222', fontSize: 16, marginBottom: 40, lineHeight: '24px' }}>
17
+ 检测到您的登录环境或网络信息有变动,为保障账户安全,请重新登录验证身份
18
+ </div>
19
+ <div style={{ display: 'flex', justifyContent: 'center' }}>
20
+ <Button
21
+ style={{
22
+ background: '#1677ff',
23
+ color: '#fff',
24
+ border: 'none',
25
+ width: 160,
26
+ height: 44,
27
+ fontSize: 18,
28
+ fontWeight: 500,
29
+ borderRadius: 8,
30
+ boxShadow: '0 2px 8px rgba(22,119,255,0.08)',
31
+ }}
32
+ onClick={onClose}
33
+ >
34
+ 好的
35
+ </Button>
36
+ </div>
37
+ </Modal>
38
+ );
39
+ };
40
+
41
+ export default ReLoginModal;
@@ -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(60);
10
+ const [countdown, setCountdown] = useState(2);
11
11
  const [otp, setOtp] = useState('');
12
12
  const [captchaImage, setCaptchaImage] = useState<string>('');
13
13
  const [captchCode, setCaptchCode] = useState<string>('');
@@ -54,7 +54,9 @@ 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)
57
58
  const { code, detail } = res.data?.status || {};
59
+ console.log('打印code', code)
58
60
  if (code !== 0) {
59
61
  message.error(detail || t('sendFailed', lang));
60
62
  return;