security.js
2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import React, { Component, Fragment } from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale';
import { List } from 'antd';
// import { getTimeDistance } from '@/utils/utils';
const passwordStrength = {
strong: (
<font className="strong">
<FormattedMessage id="BLOCK_BAME.security.strong" defaultMessage="Strong" />
</font>
),
medium: (
<font className="medium">
<FormattedMessage id="BLOCK_BAME.security.medium" defaultMessage="Medium" />
</font>
),
weak: (
<font className="weak">
<FormattedMessage id="BLOCK_BAME.security.weak" defaultMessage="Weak" />
Weak
</font>
),
};
class SecurityView extends Component {
getData = () => [
{
title: formatMessage({ id: 'BLOCK_BAME.security.password' }, {}),
description: (
<Fragment>
{formatMessage({ id: 'BLOCK_BAME.security.password-description' })}:
{passwordStrength.strong}
</Fragment>
),
actions: [
<a>
<FormattedMessage id="BLOCK_BAME.security.modify" defaultMessage="Modify" />
</a>,
],
},
{
title: formatMessage({ id: 'BLOCK_BAME.security.phone' }, {}),
description: `${formatMessage(
{ id: 'BLOCK_BAME.security.phone-description' },
{}
)}:138****8293`,
actions: [
<a>
<FormattedMessage id="BLOCK_BAME.security.modify" defaultMessage="Modify" />
</a>,
],
},
{
title: formatMessage({ id: 'BLOCK_BAME.security.question' }, {}),
description: formatMessage({ id: 'BLOCK_BAME.security.question-description' }, {}),
actions: [
<a>
<FormattedMessage id="BLOCK_BAME.security.set" defaultMessage="Set" />
</a>,
],
},
{
title: formatMessage({ id: 'BLOCK_BAME.security.email' }, {}),
description: `${formatMessage(
{ id: 'BLOCK_BAME.security.email-description' },
{}
)}:ant***sign.com`,
actions: [
<a>
<FormattedMessage id="BLOCK_BAME.security.modify" defaultMessage="Modify" />
</a>,
],
},
{
title: formatMessage({ id: 'BLOCK_BAME.security.mfa' }, {}),
description: formatMessage({ id: 'BLOCK_BAME.security.mfa-description' }, {}),
actions: [
<a>
<FormattedMessage id="BLOCK_BAME.security.bind" defaultMessage="Bind" />
</a>,
],
},
];
render() {
return (
<Fragment>
<List
itemLayout="horizontal"
dataSource={this.getData()}
renderItem={item => (
<List.Item actions={item.actions}>
<List.Item.Meta title={item.title} description={item.description} />
</List.Item>
)}
/>
</Fragment>
);
}
}
export default SecurityView;