message-verify 1.0.1-beta.55 → 1.0.1-beta.59

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 CHANGED
@@ -1,4 +1,5 @@
1
1
  {
2
+ "project.name": "message-verify",
2
3
  "phabricator.uri": "https://code.yangqianguan.com/",
3
4
  "lint.engine": "YqgWebDiffLintEngine"
4
5
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { VerifyModalConfig, LoginModalConfig } from './utils/type.js';
2
2
  export declare const initFingerprint: () => Promise<string>;
3
3
  export declare const createReLoginModal: (modalProps: LoginModalConfig) => void;
4
- export declare const VerifyHandler: ({ data, config, http, verifyPromise, sendApi }: VerifyModalConfig) => Promise<any>;
4
+ export declare const VerifyHandler: ({ data, config, http, verifyPromise, sendApi, response }: VerifyModalConfig) => Promise<any>;
package/dist/index.js CHANGED
@@ -54,7 +54,8 @@ export const createReLoginModal = (modalProps) => {
54
54
  const reLoginModalId = 'relogin-modal-container';
55
55
  creatModal(modalProps, reLoginModalId, ReLoginModal);
56
56
  };
57
- export const VerifyHandler = ({ data, config, http, verifyPromise, sendApi }) => {
57
+ export const VerifyHandler = ({ data, config, http, verifyPromise, sendApi, response }) => {
58
+ console.log('VerifyHandler =>', response);
58
59
  const toEmpty = () => {
59
60
  verifyPromise.current = null;
60
61
  };
package/dist/main.js CHANGED
@@ -38,7 +38,7 @@ const config = {
38
38
  };
39
39
  const promise = { current: null };
40
40
  createRoot(document.getElementById('root')).render(_jsxs(_Fragment, { children: [_jsx("button", { onClick: () => {
41
- return VerifyHandler({ data, config, http: axios, verifyPromise: promise });
41
+ return VerifyHandler({ data, config, http: axios, verifyPromise: promise, response: {} });
42
42
  }, children: "Show verify Modal" }), _jsx("button", { onClick: () => createReLoginModal({
43
43
  goLogin: () => {
44
44
  console.log('goLogin');
@@ -11,7 +11,7 @@ const CreateMessageVerifyModal = ({ props }) => {
11
11
  const [captchaImage, setCaptchaImage] = useState('');
12
12
  const [captchCode, setCaptchCode] = useState('');
13
13
  const [captchaKey, setCaptchaKey] = useState('');
14
- const { data, http, lang, sendApi = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty, onClose } = props || {};
14
+ const { data, http, lang, sendApi = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty, onClose, response } = props || {};
15
15
  const dataObj = JSON.parse(data || '{}');
16
16
  const { mobile, verifyCodeKey } = dataObj || {};
17
17
  const getKey = async () => {
@@ -86,6 +86,7 @@ const CreateMessageVerifyModal = ({ props }) => {
86
86
  'Content-Type': config.headers['Content-Type'],
87
87
  }
88
88
  }).then(res => {
89
+ console.log('VerifyHandler => then', response);
89
90
  resolve(res);
90
91
  }).catch(err => {
91
92
  reject(err);
@@ -93,7 +94,7 @@ const CreateMessageVerifyModal = ({ props }) => {
93
94
  })
94
95
  ]);
95
96
  if (res?.data?.status?.code === 0) {
96
- apiResolve(res);
97
+ // apiResolve(res);
97
98
  setVisible(false);
98
99
  }
99
100
  else {
@@ -25,6 +25,7 @@ export type VerifyModalConfig = {
25
25
  verifyPromise: {
26
26
  current: Promise<any> | null;
27
27
  };
28
+ response: any;
28
29
  };
29
30
  export type LoginModalConfig = {
30
31
  goLogin: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "message-verify",
3
- "version": "1.0.1-beta.55",
3
+ "version": "1.0.1-beta.59",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "dependencies": {
package/src/index.tsx CHANGED
@@ -64,7 +64,8 @@ export const createReLoginModal = (modalProps: LoginModalConfig) => {
64
64
  creatModal(modalProps, reLoginModalId, ReLoginModal);
65
65
  }
66
66
 
67
- export const VerifyHandler = ({data, config, http, verifyPromise, sendApi}: VerifyModalConfig): Promise<any> => {
67
+ export const VerifyHandler = ({data, config, http, verifyPromise, sendApi, response}: VerifyModalConfig): Promise<any> => {
68
+ console.log('VerifyHandler =>', response);
68
69
  const toEmpty = () => {
69
70
  verifyPromise.current = null;
70
71
  };
package/src/main.tsx CHANGED
@@ -43,7 +43,7 @@ const promise = {current: null};
43
43
  createRoot(document.getElementById('root')!).render(
44
44
  <>
45
45
  <button onClick={() => {
46
- return VerifyHandler({data, config, http: axios, verifyPromise: promise});
46
+ return VerifyHandler({data, config, http: axios, verifyPromise: promise, response: {}});
47
47
  }}>
48
48
  Show verify Modal
49
49
  </button>
@@ -12,7 +12,7 @@ const CreateMessageVerifyModal = ({ props }: { props: VerifyModalConfig }) => {
12
12
  const [captchaImage, setCaptchaImage] = useState<string>('');
13
13
  const [captchCode, setCaptchCode] = useState<string>('');
14
14
  const [captchaKey, setCaptchaKey] = useState<string>('');
15
- const { data, http, lang, sendApi = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty, onClose } = props || {};
15
+ const { data, http, lang, sendApi = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty, onClose, response } = props || {};
16
16
  const dataObj = JSON.parse(data || '{}');
17
17
  const { mobile, verifyCodeKey } = dataObj || {};
18
18
 
@@ -102,6 +102,7 @@ const CreateMessageVerifyModal = ({ props }: { props: VerifyModalConfig }) => {
102
102
  'Content-Type': config.headers['Content-Type'],
103
103
  }
104
104
  }).then(res => {
105
+ console.log('VerifyHandler => then', response);
105
106
  resolve(res);
106
107
  }).catch(err => {
107
108
  reject(err);
@@ -109,7 +110,7 @@ const CreateMessageVerifyModal = ({ props }: { props: VerifyModalConfig }) => {
109
110
  })
110
111
  ]) as any;
111
112
  if (res?.data?.status?.code === 0) {
112
- apiResolve(res);
113
+ // apiResolve(res);
113
114
  setVisible(false);
114
115
  } else {
115
116
  message.error(t('verifyFail', lang));
package/src/utils/type.ts CHANGED
@@ -24,6 +24,7 @@ export type VerifyModalConfig = {
24
24
  apiResolve?: any;
25
25
  apiPromiseToEmpty?: () => void;
26
26
  verifyPromise: {current: Promise<any> | null}
27
+ response: any;
27
28
  }
28
29
 
29
30
  export type LoginModalConfig = {