commit | author | age
|
9bcb19
|
1 |
<template> |
I |
2 |
<div> |
|
3 |
<a-list |
|
4 |
itemLayout="horizontal" |
|
5 |
:dataSource="data" |
|
6 |
> |
|
7 |
<a-list-item slot="renderItem" slot-scope="item, MenuIndex" :key="MenuIndex"> |
|
8 |
<a-list-item-meta> |
|
9 |
<a slot="title">{{ item.title }}</a> |
|
10 |
<span slot="description"> |
|
11 |
<span class="security-list-description">{{ item.description }}</span> |
|
12 |
<span v-if="item.value"> : </span> |
|
13 |
<span class="security-list-value">{{ item.value }}</span> |
|
14 |
</span> |
|
15 |
</a-list-item-meta> |
|
16 |
<template v-if="item.actions"> |
|
17 |
<a slot="actions" @click="item.actions.callback">{{ item.actions.title }}</a> |
|
18 |
</template> |
|
19 |
</a-list-item> |
|
20 |
</a-list> |
|
21 |
<upd-pwd ref="updPwd"/> |
|
22 |
</div> |
|
23 |
</template> |
|
24 |
|
|
25 |
<script> |
|
26 |
import { mapGetters } from 'vuex' |
|
27 |
import UpdPwd from './securityItem/updPwd' |
|
28 |
export default { |
|
29 |
components: { |
|
30 |
UpdPwd |
|
31 |
}, |
|
32 |
data () { |
|
33 |
return { |
|
34 |
data: [] |
|
35 |
} |
|
36 |
}, |
|
37 |
created () { |
|
38 |
if (this.hasPerm('sysUser:updatePwd')) { |
|
39 |
const updPwdMenu = { |
|
40 |
title: '账户密码', |
|
41 |
description: '当前密码强度', |
|
42 |
value: '强', |
|
43 |
actions: { title: '修改', |
|
44 |
callback: () => { |
|
45 |
this.$refs.updPwd.open(this.userInfo.id) |
|
46 |
} |
|
47 |
} |
|
48 |
} |
|
49 |
this.data.push(updPwdMenu) |
|
50 |
} |
|
51 |
const encryptedPhone = { title: '密保手机', description: '已绑定手机', value: '138****8293', actions: { title: '修改', callback: () => { this.$message.success('This is a message of success') } } } |
|
52 |
const encryptedProblem = { title: '密保问题', description: '未设置密保问题,密保问题可有效保护账户安全', value: '', actions: { title: '设置', callback: () => { this.$message.error('This is a message of error') } } } |
|
53 |
const encryptedEmail = { title: '备用邮箱', description: '已绑定邮箱', value: 'ant***sign.com', actions: { title: '修改', callback: () => { this.$message.warning('This is message of warning') } } } |
|
54 |
const encryptedMfa = { title: 'MFA 设备', description: '未绑定 MFA 设备,绑定后,可以进行二次确认', value: '', actions: { title: '绑定', callback: () => { this.$message.info('This is a normal message') } } } |
|
55 |
this.data.push(encryptedPhone) |
|
56 |
this.data.push(encryptedProblem) |
|
57 |
this.data.push(encryptedEmail) |
|
58 |
this.data.push(encryptedMfa) |
|
59 |
}, |
|
60 |
computed: { |
|
61 |
...mapGetters(['userInfo']) |
|
62 |
}, |
|
63 |
methods: { |
|
64 |
} |
|
65 |
} |
|
66 |
</script> |
|
67 |
|
|
68 |
<style scoped> |
|
69 |
|
|
70 |
</style> |