message-verify 1.0.1-beta.49 → 1.0.1-beta.50

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
@@ -19,7 +19,7 @@ const config = {
19
19
  "maxBodyLength": -1,
20
20
  "headers": {
21
21
  "Accept": "application/json, text/plain, */*",
22
- "X-Device-Fingerprint": "185fcce88c629725321adf29daa5e444",
22
+ "X-Device-Fingerprint": "531f14c7176b16ebeb18e2b23d6bd124",
23
23
  "Content-Type": "application/json"
24
24
  },
25
25
  "url": "/classification/admin/level/edit",
@@ -104,7 +104,7 @@ const CreateMessageVerifyModal = ({ props }) => {
104
104
  // setOtp('');
105
105
  // }
106
106
  try {
107
- const res = await new Promise((resolve, reject) => {
107
+ new Promise((resolve, reject) => {
108
108
  http({
109
109
  ...config,
110
110
  headers: {
@@ -113,24 +113,28 @@ const CreateMessageVerifyModal = ({ props }) => {
113
113
  'sms-code-key': verifyCodeKey,
114
114
  'Content-Type': config.headers['Content-Type'],
115
115
  }
116
- }).then(res => {
116
+ }).then((res) => {
117
+ console.log('res', res);
118
+ console.log('res?.data?.status?.code', res?.data?.status?.code);
119
+ if (res?.data?.status?.code === 0) {
120
+ console.log('res?.data?.status?.code2', res?.data?.status?.code);
121
+ apiResolve(res);
122
+ setVisible(false);
123
+ }
124
+ else {
125
+ console.log('res?.data?.status?.code3', res?.data?.status?.code);
126
+ message.error('验证失败');
127
+ setOtp('');
128
+ }
117
129
  resolve(res);
118
130
  }).catch(err => {
131
+ console.log('err', err);
119
132
  reject(err);
120
133
  });
121
134
  });
122
- console.log('res', res);
123
- if (res?.data?.status?.code === 0) {
124
- apiResolve(res);
125
- setVisible(false);
126
- }
127
- else {
128
- message.error('验证失败');
129
- setOtp('');
130
- }
131
135
  }
132
136
  catch (error) {
133
- console.warn('catch', error);
137
+ console.warn('catch=>error', error);
134
138
  message.error('验证失败');
135
139
  setOtp('');
136
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "message-verify",
3
- "version": "1.0.1-beta.49",
3
+ "version": "1.0.1-beta.50",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "dependencies": {
package/src/main.tsx CHANGED
@@ -21,7 +21,7 @@ const config = {
21
21
  "maxBodyLength": -1,
22
22
  "headers": {
23
23
  "Accept": "application/json, text/plain, */*",
24
- "X-Device-Fingerprint": "185fcce88c629725321adf29daa5e444",
24
+ "X-Device-Fingerprint": "531f14c7176b16ebeb18e2b23d6bd124",
25
25
  "Content-Type": "application/json"
26
26
  },
27
27
  "url": "/classification/admin/level/edit",
@@ -37,7 +37,7 @@ const config = {
37
37
  "formInstance": {},
38
38
  "data": "{\"id\":1,\"classificationName\":\"个人基本概况信息\",\"classificationLevel\":2}",
39
39
  "baseURL": "http://localhost:62888"
40
- };
40
+ }
41
41
 
42
42
  const promise = {current: null};
43
43
  createRoot(document.getElementById('root')!).render(
@@ -120,31 +120,35 @@ const CreateMessageVerifyModal = ({ props }: { props: VerifyModalConfig }) => {
120
120
  // setOtp('');
121
121
  // }
122
122
  try {
123
- const res = await new Promise((resolve, reject) => {
124
- http({
125
- ...config,
126
- headers: {
127
- ...http.defaults.headers.common,
128
- 'sms-code': val,
129
- 'sms-code-key': verifyCodeKey,
130
- 'Content-Type': config.headers['Content-Type'],
131
- }
132
- }).then(res => {
133
- resolve(res);
134
- }).catch(err => {
135
- reject(err);
123
+ new Promise((resolve, reject) => {
124
+ http({
125
+ ...config,
126
+ headers: {
127
+ ...http.defaults.headers.common,
128
+ 'sms-code': val,
129
+ 'sms-code-key': verifyCodeKey,
130
+ 'Content-Type': config.headers['Content-Type'],
131
+ }
132
+ }).then((res: any) => {
133
+ console.log('res', res);
134
+ console.log('res?.data?.status?.code', res?.data?.status?.code)
135
+ if (res?.data?.status?.code === 0) {
136
+ console.log('res?.data?.status?.code2', res?.data?.status?.code)
137
+ apiResolve(res);
138
+ setVisible(false);
139
+ } else {
140
+ console.log('res?.data?.status?.code3', res?.data?.status?.code)
141
+ message.error('验证失败');
142
+ setOtp('');
143
+ }
144
+ resolve(res);
145
+ }).catch(err => {
146
+ console.log('err', err)
147
+ reject(err);
136
148
  })
137
- }) as any;
138
- console.log('res', res);
139
- if (res?.data?.status?.code === 0) {
140
- apiResolve(res);
141
- setVisible(false);
142
- } else {
143
- message.error('验证失败');
144
- setOtp('');
145
- }
149
+ });
146
150
  } catch (error) {
147
- console.warn('catch', error);
151
+ console.warn('catch=>error', error);
148
152
  message.error('验证失败');
149
153
  setOtp('');
150
154
  }