message-verify 1.0.1-beta.0 → 1.0.1-beta.1
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 +30 -1
- package/dist/verify-modal.js +11 -2
- package/package.json +1 -1
- package/src/main.tsx +30 -1
- package/src/verify-modal.tsx +10 -2
package/dist/main.js
CHANGED
@@ -7,7 +7,36 @@ const fp = await initFingerprint();
|
|
7
7
|
console.log(fp);
|
8
8
|
createRoot(document.getElementById('root')).render(_jsx(_Fragment, { children: _jsx("button", { onClick: () => createMessageVerifyModal({
|
9
9
|
data,
|
10
|
-
config: {
|
10
|
+
config: {
|
11
|
+
"transitional": {
|
12
|
+
"silentJSONParsing": true,
|
13
|
+
"forcedJSONParsing": true,
|
14
|
+
"clarifyTimeoutError": false
|
15
|
+
},
|
16
|
+
"timeout": 0,
|
17
|
+
"xsrfCookieName": "XSRF-TOKEN",
|
18
|
+
"xsrfHeaderName": "X-XSRF-TOKEN",
|
19
|
+
"maxContentLength": -1,
|
20
|
+
"maxBodyLength": -1,
|
21
|
+
"headers": {
|
22
|
+
"Accept": "application/json, text/plain, */*",
|
23
|
+
"X-Device-Fingerprint": "185fcce88c629725321adf29daa5e444",
|
24
|
+
"Content-Type": "application/json"
|
25
|
+
},
|
26
|
+
"url": "/classification/admin/level/edit",
|
27
|
+
"method": "post",
|
28
|
+
"dataFormat": "JSON",
|
29
|
+
"showRequestData": true,
|
30
|
+
"showResponseData": false,
|
31
|
+
"showGeneralResponseData": true,
|
32
|
+
"headersList": [],
|
33
|
+
"requestDataFunc": "\nfunction(formFilterData){\n // 这里写你的处理逻辑\n return {\n ...formFilterData,\n 'classificationLevel': 2 //等级\n }\n}\n",
|
34
|
+
"responseDataFunc": "",
|
35
|
+
"responseGeneralDataFunc": "function(req, { data, util, window }) {\n return req\n .then((response) => {\n return Promise.resolve({\n status: {\n code: 0,\n }\n })\n })\n .catch((error) => {\n // 检查是否有响应数据\n if (error.response && error.response.data) {\n const responseData = error.response.data;\n const detail = responseData.body?.status?.detail || responseData.status?.detail;\n if (detail) {\n util.message.error(detail);\n } else {\n util.message.error('编辑失败,请重试');\n }\n } else {\n util.message.error('编辑失败,请重试');\n }\n console.error('Error during deletion:', error);\n });\n}",
|
36
|
+
"formInstance": {},
|
37
|
+
"data": "{\"id\":1,\"classificationName\":\"个人基本概况信息\",\"classificationLevel\":2}",
|
38
|
+
"baseURL": "http://localhost:62888"
|
39
|
+
},
|
11
40
|
lang: 'en',
|
12
41
|
http: axios,
|
13
42
|
}), children: "Show verify Modal" }) }));
|
package/dist/verify-modal.js
CHANGED
@@ -66,7 +66,7 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
66
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) => {
|
67
67
|
setOtp(val);
|
68
68
|
if (val.length === 6) {
|
69
|
-
http({
|
69
|
+
const res = await http({
|
70
70
|
...config,
|
71
71
|
headers: {
|
72
72
|
...http.defaults.headers.common,
|
@@ -75,7 +75,16 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
75
75
|
'Content-Type': config.headers['Content-Type'],
|
76
76
|
}
|
77
77
|
});
|
78
|
-
|
78
|
+
console.log(res, 'res');
|
79
|
+
const { data: { status: { code, detail } = {} } } = res;
|
80
|
+
if (code !== 0) {
|
81
|
+
message.error(detail || t('verifyFailed', lang));
|
82
|
+
return;
|
83
|
+
}
|
84
|
+
else {
|
85
|
+
message.success(t('verifySuccess', lang));
|
86
|
+
setVisible(false);
|
87
|
+
}
|
79
88
|
}
|
80
89
|
} }), _jsx(Button, { disabled: countdown > 0 || !captchCode, onClick: handleResend, style: { padding: '8px' }, children: countdown > 0 ? t('countDownSecound', lang, { countdown }) : t('reSend', lang) })] }), countdown > 0 ? null :
|
81
90
|
_jsxs("div", { style: { marginTop: 12, display: 'flex', alignItems: 'center' }, children: [_jsx(Input, { placeholder: t('pleaseEnterPicVerifyCode', lang), onChange: (e) => {
|
package/package.json
CHANGED
package/src/main.tsx
CHANGED
@@ -11,7 +11,36 @@ createRoot(document.getElementById('root')!).render(
|
|
11
11
|
<>
|
12
12
|
<button onClick={() => createMessageVerifyModal({
|
13
13
|
data,
|
14
|
-
config: {
|
14
|
+
config: {
|
15
|
+
"transitional": {
|
16
|
+
"silentJSONParsing": true,
|
17
|
+
"forcedJSONParsing": true,
|
18
|
+
"clarifyTimeoutError": false
|
19
|
+
},
|
20
|
+
"timeout": 0,
|
21
|
+
"xsrfCookieName": "XSRF-TOKEN",
|
22
|
+
"xsrfHeaderName": "X-XSRF-TOKEN",
|
23
|
+
"maxContentLength": -1,
|
24
|
+
"maxBodyLength": -1,
|
25
|
+
"headers": {
|
26
|
+
"Accept": "application/json, text/plain, */*",
|
27
|
+
"X-Device-Fingerprint": "185fcce88c629725321adf29daa5e444",
|
28
|
+
"Content-Type": "application/json"
|
29
|
+
},
|
30
|
+
"url": "/classification/admin/level/edit",
|
31
|
+
"method": "post",
|
32
|
+
"dataFormat": "JSON",
|
33
|
+
"showRequestData": true,
|
34
|
+
"showResponseData": false,
|
35
|
+
"showGeneralResponseData": true,
|
36
|
+
"headersList": [],
|
37
|
+
"requestDataFunc": "\nfunction(formFilterData){\n // 这里写你的处理逻辑\n return {\n ...formFilterData,\n 'classificationLevel': 2 //等级\n }\n}\n",
|
38
|
+
"responseDataFunc": "",
|
39
|
+
"responseGeneralDataFunc": "function(req, { data, util, window }) {\n return req\n .then((response) => {\n return Promise.resolve({\n status: {\n code: 0,\n }\n })\n })\n .catch((error) => {\n // 检查是否有响应数据\n if (error.response && error.response.data) {\n const responseData = error.response.data;\n const detail = responseData.body?.status?.detail || responseData.status?.detail;\n if (detail) {\n util.message.error(detail);\n } else {\n util.message.error('编辑失败,请重试');\n }\n } else {\n util.message.error('编辑失败,请重试');\n }\n console.error('Error during deletion:', error);\n });\n}",
|
40
|
+
"formInstance": {},
|
41
|
+
"data": "{\"id\":1,\"classificationName\":\"个人基本概况信息\",\"classificationLevel\":2}",
|
42
|
+
"baseURL": "http://localhost:62888"
|
43
|
+
},
|
15
44
|
lang: 'en',
|
16
45
|
http: axios,
|
17
46
|
})}>
|
package/src/verify-modal.tsx
CHANGED
@@ -81,7 +81,7 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
81
81
|
onChange={async (val) => {
|
82
82
|
setOtp(val);
|
83
83
|
if (val.length === 6) {
|
84
|
-
http({
|
84
|
+
const res = await http({
|
85
85
|
...config,
|
86
86
|
headers: {
|
87
87
|
...http.defaults.headers.common,
|
@@ -90,7 +90,15 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
|
|
90
90
|
'Content-Type': config.headers['Content-Type'],
|
91
91
|
}
|
92
92
|
}) as any;
|
93
|
-
|
93
|
+
console.log(res, 'res');
|
94
|
+
const {data: {status: {code, detail} = {}}} = res;
|
95
|
+
if(code !== 0) {
|
96
|
+
message.error(detail || t('verifyFailed', lang));
|
97
|
+
return;
|
98
|
+
} else {
|
99
|
+
message.success(t('verifySuccess', lang));
|
100
|
+
setVisible(false);
|
101
|
+
}
|
94
102
|
}
|
95
103
|
}} />
|
96
104
|
<Button
|