message-verify 1.0.1-beta.54 → 1.0.1-beta.57
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 +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/locales/en.d.ts +1 -0
- package/dist/locales/en.js +2 -1
- package/dist/locales/id.d.ts +1 -0
- package/dist/locales/id.js +2 -1
- package/dist/locales/zh.d.ts +1 -0
- package/dist/locales/zh.js +2 -1
- package/dist/main.js +1 -1
- package/dist/modal/verify-modal.js +4 -11
- package/dist/utils/type.d.ts +1 -0
- package/package.json +1 -1
- package/src/index.tsx +2 -1
- package/src/locales/en.ts +2 -1
- package/src/locales/id.ts +2 -1
- package/src/locales/zh.ts +2 -1
- package/src/main.tsx +1 -1
- package/src/modal/verify-modal.tsx +4 -11
- package/src/utils/type.ts +1 -0
package/.arcconfig
CHANGED
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/locales/en.d.ts
CHANGED
package/dist/locales/en.js
CHANGED
@@ -10,5 +10,6 @@ export default {
|
|
10
10
|
accountAlert: 'Account Security Alert',
|
11
11
|
alertContent: 'Changes have been detected in your login environment or network information.To ensure account security, please log in again to verify your identity.',
|
12
12
|
ok: 'OK',
|
13
|
-
chidoriOpenPro: 'Chidori has activated security protection for you'
|
13
|
+
chidoriOpenPro: 'Chidori has activated security protection for you',
|
14
|
+
verifyFail: 'Validation failed'
|
14
15
|
};
|
package/dist/locales/id.d.ts
CHANGED
package/dist/locales/id.js
CHANGED
@@ -10,5 +10,6 @@ export default {
|
|
10
10
|
accountAlert: 'Peringatan Keamanan Akun',
|
11
11
|
alertContent: 'Terdeteksi perubahan pada lingkungan login atau informasi jaringan Anda.Untuk menjaga keamanan akun, silakan login kembali untuk memverifikasi identitas Anda.',
|
12
12
|
ok: 'Baiklah',
|
13
|
-
chidoriOpenPro: 'chidori telah mengaktifkan keamanan untuk Anda'
|
13
|
+
chidoriOpenPro: 'chidori telah mengaktifkan keamanan untuk Anda',
|
14
|
+
verifyFail: 'Autentikasi gagal'
|
14
15
|
};
|
package/dist/locales/zh.d.ts
CHANGED
package/dist/locales/zh.js
CHANGED
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');
|
@@ -68,15 +68,13 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
68
68
|
onClose?.();
|
69
69
|
}, 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) => {
|
70
70
|
setOtp(val);
|
71
|
-
console.log('val', val);
|
72
71
|
if (val.length === 6) {
|
73
|
-
console.log('val2===>');
|
74
72
|
try {
|
75
73
|
const res = await Promise.race([
|
76
74
|
new Promise((resolve, reject) => {
|
77
75
|
setTimeout(() => {
|
78
76
|
reject(new Error('Timeout'));
|
79
|
-
},
|
77
|
+
}, 1000);
|
80
78
|
}),
|
81
79
|
new Promise((resolve, reject) => {
|
82
80
|
http({
|
@@ -88,29 +86,24 @@ const CreateMessageVerifyModal = ({ props }) => {
|
|
88
86
|
'Content-Type': config.headers['Content-Type'],
|
89
87
|
}
|
90
88
|
}).then(res => {
|
91
|
-
console.log('res', res);
|
92
89
|
resolve(res);
|
93
90
|
}).catch(err => {
|
94
|
-
console.log('err', err);
|
95
91
|
reject(err);
|
96
92
|
});
|
97
93
|
})
|
98
94
|
]);
|
99
|
-
console.log('res', res);
|
100
95
|
if (res?.data?.status?.code === 0) {
|
101
|
-
|
102
|
-
apiResolve(res);
|
96
|
+
// apiResolve(res);
|
103
97
|
setVisible(false);
|
104
98
|
}
|
105
99
|
else {
|
106
|
-
|
107
|
-
message.error('验证失败');
|
100
|
+
message.error(t('verifyFail', lang));
|
108
101
|
setOtp('');
|
109
102
|
}
|
110
103
|
}
|
111
104
|
catch (error) {
|
112
105
|
console.warn('catch=>error', error);
|
113
|
-
message.error('
|
106
|
+
message.error(t('verifyFail', lang));
|
114
107
|
setOtp('');
|
115
108
|
}
|
116
109
|
}
|
package/dist/utils/type.d.ts
CHANGED
package/package.json
CHANGED
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/locales/en.ts
CHANGED
@@ -10,5 +10,6 @@ export default {
|
|
10
10
|
accountAlert: 'Account Security Alert',
|
11
11
|
alertContent: 'Changes have been detected in your login environment or network information.To ensure account security, please log in again to verify your identity.',
|
12
12
|
ok: 'OK',
|
13
|
-
chidoriOpenPro: 'Chidori has activated security protection for you'
|
13
|
+
chidoriOpenPro: 'Chidori has activated security protection for you',
|
14
|
+
verifyFail: 'Validation failed'
|
14
15
|
};
|
package/src/locales/id.ts
CHANGED
@@ -10,5 +10,6 @@ export default {
|
|
10
10
|
accountAlert: 'Peringatan Keamanan Akun',
|
11
11
|
alertContent: 'Terdeteksi perubahan pada lingkungan login atau informasi jaringan Anda.Untuk menjaga keamanan akun, silakan login kembali untuk memverifikasi identitas Anda.',
|
12
12
|
ok: 'Baiklah',
|
13
|
-
chidoriOpenPro: 'chidori telah mengaktifkan keamanan untuk Anda'
|
13
|
+
chidoriOpenPro: 'chidori telah mengaktifkan keamanan untuk Anda',
|
14
|
+
verifyFail: 'Autentikasi gagal'
|
14
15
|
};
|
package/src/locales/zh.ts
CHANGED
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>
|
@@ -84,15 +84,13 @@ const CreateMessageVerifyModal = ({ props }: { props: VerifyModalConfig }) => {
|
|
84
84
|
value={otp}
|
85
85
|
onChange={async (val) => {
|
86
86
|
setOtp(val);
|
87
|
-
console.log('val', val);
|
88
87
|
if (val.length === 6) {
|
89
|
-
console.log('val2===>');
|
90
88
|
try {
|
91
89
|
const res = await Promise.race([
|
92
90
|
new Promise((resolve, reject) => {
|
93
91
|
setTimeout(() => {
|
94
92
|
reject(new Error('Timeout'));
|
95
|
-
},
|
93
|
+
}, 1000);
|
96
94
|
}),
|
97
95
|
new Promise((resolve, reject) => {
|
98
96
|
http({
|
@@ -104,27 +102,22 @@ const CreateMessageVerifyModal = ({ props }: { props: VerifyModalConfig }) => {
|
|
104
102
|
'Content-Type': config.headers['Content-Type'],
|
105
103
|
}
|
106
104
|
}).then(res => {
|
107
|
-
console.log('res', res);
|
108
105
|
resolve(res);
|
109
106
|
}).catch(err => {
|
110
|
-
console.log('err', err);
|
111
107
|
reject(err);
|
112
108
|
})
|
113
109
|
})
|
114
110
|
]) as any;
|
115
|
-
console.log('res', res);
|
116
111
|
if (res?.data?.status?.code === 0) {
|
117
|
-
|
118
|
-
apiResolve(res);
|
112
|
+
// apiResolve(res);
|
119
113
|
setVisible(false);
|
120
114
|
} else {
|
121
|
-
|
122
|
-
message.error('验证失败');
|
115
|
+
message.error(t('verifyFail', lang));
|
123
116
|
setOtp('');
|
124
117
|
}
|
125
118
|
} catch (error) {
|
126
119
|
console.warn('catch=>error', error);
|
127
|
-
message.error('
|
120
|
+
message.error(t('verifyFail', lang));
|
128
121
|
setOtp('');
|
129
122
|
}
|
130
123
|
}
|